Skip to main content

Timeline for How to get store name in template?

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
S Feb 16, 2017 at 2:12 history suggested Darren Felton CC BY-SA 3.0
Injecting ScopeConfigInterface in Block classes causes compile warnings because it is already available from the $context parameter passed to \Magento\Framework\View\Element\AbstractBlock
Feb 16, 2017 at 0:57 review Suggested edits
S Feb 16, 2017 at 2:12
Feb 15, 2017 at 20:49 review Suggested edits
Feb 15, 2017 at 21:11
S Nov 9, 2016 at 12:37 history edited Marius CC BY-SA 3.0
minor typo
S Nov 9, 2016 at 12:37 history suggested Giel Berkers CC BY-SA 3.0
minor typo
Nov 9, 2016 at 12:36 review Suggested edits
S Nov 9, 2016 at 12:37
May 19, 2016 at 9:37 comment added Razvan @Marius 's approach is right, but it didn't work for me. Instead I've used \Magento\Store\Model\StoreManagerInterface $storeManager in constructor and public function getStoreName() { return $this->storeManager->getStore()->getName(); } Instead of getName() you can use getCode(), getId().
Dec 14, 2015 at 10:37 vote accept Dominik Barann
Dec 14, 2015 at 9:37 comment added Marius clear the var/generation folder
Dec 14, 2015 at 9:36 comment added Dominik Barann Loos like a great solution, but I get the following error: Fatal error: Call to a member function dispatch() on a non-object in /vendor/magento/framework/View/Element/AbstractBlock.php on line 637.
Dec 14, 2015 at 9:16 history answered Marius CC BY-SA 3.0