PHP code example of bonfim / tpl

1. Go to this page and download the library: Download bonfim/tpl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bonfim / tpl example snippets

 php


 php
Tpl::assing('title', 'Hello!');
Tpl::render('test');
 php


Tpl::assign('title', 'Sketch');
 php


Tpl::assign('name', 'edson onildo');
 php


Tpl::assign('age', 19);
 php


$authors = [
    [
        'name' => 'Edson Onildo',
        'page' => 'https://github.com/EdsonOnildoJR'
    ],
    [
        'name' => 'Contributors',
        'page' => 'https://github.com/EdsonOnildoJR/Sketch/contributors'
    ]
];

Tpl::assign('authors', $authors);
 html
<h1>New user:</h1>
{template 'userForm'}
 html
<h1>New user:</h1>
<form class="user" action="" method="post">
    ...
</form>