PHP code example of myerscode / templex

1. Go to this page and download the library: Download myerscode/templex 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/ */

    

myerscode / templex example snippets

 
$templateDirectory = __DIR__ . '/Resources/Templates/;
$templateExtentions = 'stub';
$templex = new Templex($templateDirectory, $templateExtentions);

echo $templex->render('index');
text
<{ if( $value === 'foobar' ) }>
...
<{ if( $value > 7 ) }>
...
<{ if( $value == true ) }>
...
<{ if( $value != false ) }>
text
<ul class="row">
    <{ foreach( $users as $user ) }>
        <li><{ $user }></li>
    <{ endforeach }>
</ul>
text
Hi <{ $name }>!