|  Download maskMask is a PHP trait that functions as a basic PHP template engine Tutorial__create a simple view to hold ALL view logic__ 
class MyView
{
    protected $title = 'Hello';
    protected function logic()
    {
        return 'World!';
    }
}
 __add mask__ 
use Taviroquai\Mask\Mask;
class MyView
{
    use Mask;
    
    protected $title = 'Hello';
    protected function logic()
    {
        return 'World!';
    }
}
 __now create an HTML file: template.html__ <p>
{{ title }}
{{ if logic }}{{ logic }}{{ endif }}
</p>
 __finally use it in PHP as__ 
$view = new MyView;
echo $view->mask('template');
 __output:__ <p>
Hello
World!
</p>
 APICall variables and methods{{ variableName }}
{{ methodName }} Conditions{{ if methodOrVariableName }}
... something ...
{{ endif }} Foreach loops{{ for variable as local }}   {{ local }}  
 {{ endfor }}   Includes__include partial.html__  
{{ include partial }} Options// Set cache path
Mask::$templateCachePath = './path/to/cache';
// Set templates path
Mask::$templatePath = './path/to/templates';
// Choose what properties to publish by overriding getMaskData()
class MyView
{
    use Mask;
    
    protected $property1;
    protected $property2;
    
    public function getMaskData()
    {
        return array(
            'property2' => 'override'
        );
    }
}
 |