CakePHP,Can';似乎没有一个主题可以应用
我刚刚安装了CakePHP 1.3.4稳定版。我创建了一个非常简单的应用程序,我试图让它使用主题目录视图和布局,而不是默认的 \app\controllers\tests\u controller.phpCakePHP,Can';似乎没有一个主题可以应用,cakephp,themes,Cakephp,Themes,我刚刚安装了CakePHP 1.3.4稳定版。我创建了一个非常简单的应用程序,我试图让它使用主题目录视图和布局,而不是默认的 \app\controllers\tests\u controller.php <?php class TestsController extends AppController { var $name = 'Tests'; var $uses = array(); var $theme = 'rgr'; function ind
<?php
class TestsController extends AppController {
var $name = 'Tests';
var $uses = array();
var $theme = 'rgr';
function index() {
$this->theme = 'rgr';
$this->layout = 'default';
echo "Controler = TestsController::index() ";
}
}
<?php echo $html->docType(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
Layout = No theme
<?php echo $content_for_layout; ?>
</body>
</html>
<div class="test index">
test index, no theme
</div>
<?php echo $html->docType(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
Layout = RGR
<?php echo $content_for_layout; ?>
</body>
</html>
<div class="test index">
View=test index, RGR theme
</div>
我希望看到
Controler = TestsController::index() Layout = RGR
View=test index, RGR theme
我认为这是一个简单的错误,因为似乎没有其他人有同样的问题。我已经关闭了core.php中的捕获功能
建议 您在控制器中错过了
var$view='Theme'
。这是必要的
Controler = TestsController::index() Layout = RGR
View=test index, RGR theme