CakePHP TwigView Plugin Missing View Error(CakePHP TwigView 插件缺少视图错误)
问题描述
我使用的是 CakePHP 2.4.2 和 this 插件.
我想在CakePHP 中使用TwigView,发现上面的插件与CakePHP 2.0 兼容.执行了所有安装步骤,但是在执行脚本时出现 Missing View 错误.
我的 AppController.php
视图的扩展名是 .tpl,但是,即使添加了插件,它仍然在寻找 .ctp 扩展名.
我还在 bootstrap.php 中使用
加载了插件CakePlugin::load('TwigView');定义('TWIG_VIEW_CACHE',APP.'tmp');不知道会出什么问题.
http://api.cakephp.org/2.4/source-class-Controller.html#209-214
将应用控制器中的 Controller::$ext 属性设置为tpl"即可.
询问前先搜索也总是一个好主意,请参阅CakePHP 查看更改扩展>
I am using CakePHP 2.4.2 and this plugin by predominant.
I want to use TwigView with CakePHP and found that the plugin above is compatible with CakePHP 2.0. Followed all the installation steps, however, getting the Missing View error while executing the script.
My AppController.php
<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {
public $viewClass = 'TwigView.Twig';
}
The view's extention is .tpl, however, even after adding the Plugin it is still looking for .ctp extention.
I have also loaded the plugin in bootstrap.php using
CakePlugin::load('TwigView');
define('TWIG_VIEW_CACHE', APP . 'tmp');
Any Idea what could go wrong.
http://api.cakephp.org/2.4/source-class-Controller.html#209-214
Set the Controller::$ext property in your app controller to "tpl" and your're done.
Searching before asking is also always a good idea, see CakePHP View change extension
这篇关于CakePHP TwigView 插件缺少视图错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CakePHP TwigView 插件缺少视图错误
基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
