0

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.

3
  • 1
    There is an open pull request that sounds like it will fix your issue: github.com/predominant/TwigView/pull/19 Commented Nov 22, 2013 at 10:42
  • 1
    There is no fix needed, see my answer. Commented Nov 22, 2013 at 12:28
  • 1
    @burzum I think the issue is that the $ext property in the view gets overriden by the one defined in the controller, and that this worked differently when the plugin was written. Commented Nov 22, 2013 at 14:14

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.