Re: [請益] cakephp renderElement()
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
推
09/30 11:29, , 1F
09/30 11:29, 1F
→
09/30 11:30, , 2F
09/30 11:30, 2F
→
09/30 13:58, , 3F
09/30 13:58, 3F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章