$Content_for_layout for cakephp

http://ask.cakephp.org/questions/view/content_for_layout


Hi, I am new to cakephp. I start working on a project and $content_for_layout seems as MAster Page concept in dot net. I want to know how and from where $content_for_layout finds the content to be displayed.


Check this description

http://api.cakephp.org/class/view#method-ViewrenderLayout

and the source

http://api.cakephp.org/view_source/view/#line-418

Answered by burzum on 31/12/09


In short, it finds corresponding view file (which is like a template) on views/controller/action.ctp and uses variables set on action in controller i.e. $this->set('variable', 'some text'); on contrller becomes $variable on your view.

Answered by Lunks on 31/12/09


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章