Problem with usage Helper inside Cell class

Hello!
Is there a way to use helper in Cake\View\Cell class?
I’m using $helpers property to load helper, but i can’t use it’s methods, because helper instance is null…

namespace TestPlugin\View\Cell;

use Cake\View\Cell;

class NavigationBarCell extends Cell
{
    protected $_validCellOptions = [];
    
    public $helpers = [
        'Menu'
    ];
    
    public function display()
    {   
        // MenuHelper is exist, no warnings or errors, but
        // $this->Menu === null
        $this->Menu->init('main'); 
    }
}

Hi,

as far as I can see, you don’t use helpers inside the cell-class but can use helpers inside the respective ctp file that is going to be rendered when the cell is loaded.

Best regards,
dmuenstermann

Thank you very much! I have to read manuals more attentively. :3
Problem is solved now.

P.S> sry for my bad english. c:

1 Like