���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/st2/vendor/league/plates/docs/ |
--- 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 <div class="filename">profile.php</div> ~~~ php <?php $this->layout('template', ['title' => 'User Profile']) ?> <h1>User Profile</h1> <p>Hello, <?=$this->e($name)?></p> ~~~ ## The layout template <div class="filename">template.php</div> ~~~ php <html> <head> <title><?=$this->e($title)?></title> </head> <body> <?=$this->section('content')?> </body> </html> ~~~