Edited at

How to use Smarty with CakePHP 3.0

More than 3 years have passed since last update.

This is a tutorial for installing Smarty to CakePHP 3.0.

In :日本語

In :español


1. Download the SmartyView

from here: https://github.com/yukikikuchi/cakephp3-smartyview

Save SmartyView as app/src/View/SmartyView.php

2. Download the smarty template engine


Extract it to app/vendor/smarty

3. Include in your controller

(in AppController.php to do it app-wide)


class AppController extends Controller {
public $viewClass = 'App\View\SmartyView';

4. Create the layout file

Create a file app/src/Template/Layout/default.tpl and paste in that file: