PHP code example of dotblue / nette-templating

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

    

dotblue / nette-templating example snippets


use DotBlue\Templating\Helpers;

class ShoutHelper implements Helpers\IHelper
{

    public function getName()
    {
        return 'shout';
    }

    public function execute($value, Helpers\Options $options)
    {
        return $value . '!';
    }

}

public function execute($value, Helpers\Options $options)
{
    $mark = $options->first('!');
    return $value . $mark;
}

$language = $options->getLocale();
html
{var $text = 'Hi'}
{$text|shout:'!!!'} {* print "Hi!!!" *}
html
{foreach $languages as $language}
    {locale $language}
        {$money|currency}
    {/locale}
{/foreach}