1

I'm trying to create a sidebar in my template but I'm getting Cake\View\Exception\MissingElementException. I've created sidebar.ctp in /src/View/Element/ directory, and call it like this :

<?= $this->element('sidebar') ?>

How can I fix this ?

sk001
  • 561
  • 6
  • 27

1 Answers1

1

Check the docs a little more closely, template files belong into the Template directory, not the View directory.

See Cookbook > Views > Elements

ndm
  • 59,784
  • 9
  • 71
  • 110