看板 PHP 關於我們 聯絡資訊
1.3 用的是.. <?php echo $this->element('helpbox', array("helptext" => "Oh, this text is very helpful.")); ?> 1.2 用的也是一樣.. 沒有看到是 $this->renderElement('head'); 這樣的語法... 你該不會用 1.1 吧? 至於 content_for_layout 的部份..你根本不用去管他吧... 那是從 view 去塞各個 action 的內容到 layout 裡面.. ※ 引述《luo74128 (小貓)》之銘言: : ※ 引述《luo74128 (小貓)》之銘言: : : 請問一下為什麼我的cakephp : : RenderElement() 和 $content_for_layout似乎都沒有作用也 : : 要改成include()才會正常引入, : : 請我我是哪裡配置的不對嗎? : 我寫在 layouts底下 default.ctp裡 : <body> : <?php //echo $this->renderElement('head'); //原本部分沒作用 : include("../views/elements/head.ctp"); //改為include有作用 : ?> : <div id="right"> : <?php : echo $content_for_layout; //原本部分沒作用 : //include("../views/pages/home.ctp"); //改為include有作用 : ?> : </div> : <?php : //echo $this->renderElement('foot'); //原本部分沒作用 : include("../views/elements/foot.ctp"); //改為include有作用 : ?> : </body> : 煩請大大看看錯在哪了呢? -- 我是上來領便當的... 逛 php 版, database 版只是順便而已... http://blog.darkhero.net 個人網誌 http://phorum.study-area.org/index.php/board,31.0.html -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.116.62.60
luo74128:我是用官方新下載的..content_for_layout!!大大可以解釋 09/30 11:29
luo74128:一下用法嗎?我上網查看不是很瞭解說!!感謝大大 09/30 11:30
kylekai:那應該是1.3?.. 建議妳先不用去改 layout ..先弄 view 就 09/30 13:58