## Change AppView ```PHP // src/View/AppView.php namespace App\View; use WyriHaximus\TwigView\View\TwigView; class AppView extends TwigView { // Code ... } ``` ## Load Helpers ```PHP // src/View/AppView.php namespace App\View; use WyriHaximus\TwigView\View\TwigView; class AppView extends TwigView { public function initialize() { $this->loadHelper('Html'); $this->loadHelper('Form'); } ``` Note: TwigView will look for its templates with the extension `.twig` and then for `.tpl` (deprecated). ## Create the default layout to be used by TwigView named `default.twig` instead of `default.ctp` Layout example ```Twig {{ Html.charset()|raw }} {{ __('MySite') }} {{ _view.fetch('title')|raw }} {{ Html.meta('icon')|raw }} {{ Html.css('app.css')|raw }} {{ Html.script('app')|raw }} {{ _view.fetch('meta')|raw }} {{ _view.fetch('css')|raw }} {{ _view.fetch('script')|raw }}
{{ _view.fetch('header')|raw }}

{{ _view.fetch('title') }}

{{ _view.fetch('content')|raw }}
``` ## Create a view template in Template/Controller/action.twig ```Twig {{ _view.start('header') }}

It's my header

{{ _view.end() }} {{ _view.assign('title', "it's my title") }}

It's my content

```