--- layout: default permalink: simple-example/ title: Simple example --- Simple example ============== Here is a simple example of how to use Plates. We will assume the following directory stucture: ~~~ `-- path `-- to `-- templates |-- template.php |-- profile.php ~~~ ## Within your controller ~~~ php // Create new Plates instance $templates = new League\Plates\Engine('/path/to/templates'); // Render a template echo $templates->render('profile', ['name' => 'Jonathan']); ~~~ ## The page template
Hello, =$this->e($name)?>
~~~ ## The layout template