3

I created a class and I can't understand why when I pass a second parameter give a error HTTP 500.

I'm trying to do a simple code, like this:

  namespace Ahimsa\FooterLinks\Block;

  use \Magento\Framework\View\Element\Template as Template;


class FooterLinks extends Template
{
 protected $_storeManager;
 protected $categoryRepository;
 protected $_categoryHelper;

 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Helper\Category $categoryHelper)
 {

    $this->_categoryHelper = $categoryHelper;
    parent::__construct($context);
 }
}

Anyone knows what I'm doing wrong?

  • Did you run php bin/magento setup:upgrade after change the class? – Evgeny Levinsky Dec 20 '17 at 13:01
  • Thank's @Piyush for the correct sintaxe. – Diego Queiroz Dec 20 '17 at 13:01
  • 1
    Try clearing var/generation and var/cache folder – Priyank Dec 20 '17 at 13:04
  • @EvgenyLevinsky, yes. I runned bin/magento c:c and php bin/magento setup:upgrade – Diego Queiroz Dec 20 '17 at 13:05
  • 1
    I found the error :). I was executing magento commands inside cmd in Php Storm IDE. When I executed in Mac Terminal the command bin/magento setup:upgrade work's fine. Thank's guys. – Diego Queiroz Dec 20 '17 at 13:45
1

I found the error :). I was executing magento commands inside cmd in Php Storm IDE. When I executed in Mac Terminal the command bin/magento setup:upgrade work's fine. Thank's guys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.