# zf3-smarty-module Based on https://github.com/randlem/zf2-smarty-module and modified for use with ZF3 # Installation Although you could just clone this repository, it is highly recommended to install the module via composer. - run `php composer.phar require skillfish/zf3-smarty-module` - add Smarty to your ZF3 modules Configuration e.g /config/modules.config.php - change the View Manager Strategy to Smarty in your module or apllication config like: ```php [ 'strategies' => [ 'Smarty\View\Strategy' ], ], ]; ``` you might also want to change your View Manager's Template Map to actually use .tpl files instead of the default .phtml ```php [ 'template_map' => [ 'layout/layout' => '/module/Application/view/layout/layout.tpl', 'application/index/index' => '/module/Application/view/application/index/index.tpl', 'error/404' => '/module/Application/view/error/404.tpl', 'error/index' => '/module/Applicationview/error/index.tpl', ], ], ]; ``` # Template Inheritance In order for template inheritance to work, you must terminate your ViewModel inside your Controller with `$viewModel->setTerminal(true);` and make use of the smarty `{extends}` tag. Otherwise the ViewModel will render the default layout template and inheritance won't work. ### Example layout.tpl ```html