oop - Using specific controller in layout - CakePHP -
i'm newbie in cakephp , have few questions.
i'm trying set first cakephp website, , want display menu links in layout. i've created model called menuitem, i've created controller "menuitemscontroller" , function show. when access /menuitems/show/ links displayed. here's problem. want call controller in layout links visible on every subpage. first question how call controller, , second how output ? have create view cotroller if don't want use /menuitems/show/ or it's okay set controller output array of data ?
thank you!
first question how call controller, , second how output ?
use requestaction() request data view or better, set based on page you're on in appcontroller::beforeffilter() method.
in layout use an element $this->element('menu'); , use set data in or, if go requestaction() call inside element, can cache element.
read links cakephp book in text, book contains example code well.
Comments
Post a Comment