【发布时间】:2013-11-22 05:59:51
【问题描述】:
我主要使用 CakePHP 2.4.2 和 this 插件。
我想在 CakePHP 中使用 TwigView,发现上面的插件与 CakePHP 2.0 兼容。但是,按照所有安装步骤操作,在执行脚本时出现 Missing View 错误。
我的 AppController.php
<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {
public $viewClass = 'TwigView.Twig';
}
视图的扩展名是.tpl,但是,即使添加了插件,它仍然在寻找.ctp扩展名。
我还使用
在 bootstrap.php 中加载了插件CakePlugin::load('TwigView');
define('TWIG_VIEW_CACHE', APP . 'tmp');
任何想法可能会出错。
【问题讨论】:
-
有一个公开的拉取请求听起来可以解决您的问题:github.com/predominant/TwigView/pull/19
-
不需要修复,看我的回答。
-
@burzum 我认为问题在于视图中的 $ext 属性被控制器中定义的属性覆盖,并且在编写插件时它的工作方式有所不同。
标签: php cakephp cakephp-2.0 twig cakephp-2.4