CakePHP TwigView Plugin Missing View Error

烂漫一生 提交于 2019-12-30 13:39:22

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/20138038/cakephp-twigview-plugin-missing-view-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!