I need to call cell methods in my helper. I try this in my helper.
$cell = $this->cell('Inbox::expanded');
But it does not work. How can I do this?
There are two ways of doing this. The first one is to use the view instance inside the helper to render the cell:
$cell = $this->_View->cell('Inbox::expanded');
The other way is to add the CellTrait
to your helper:
class MyHelper extends Helper {
use Cake\View\CellTrait;
public function aMethod() {
$cell = $this->cell('Inbox::expanded');
}
}