简体   繁体   中英

CakePHP TwigView Plugin Missing View Error

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM