PHP Classes

File: examples/testcustomif.php

Recommend this page to a friend!
  Classes of Jorge Castro   BladeOne   examples/testcustomif.php   Download  
File: examples/testcustomif.php
Role: Example script
Content type: text/plain
Description: Example script
Class: BladeOne
Standalone template engine that compiles into PHP
Author: By
Last change: Update of examples/testcustomif.php
Date: 3 years ago
Size: 464 bytes
 

Contents

Class file image Download
<?php
use eftec\bladeone\BladeOne;

include
"../lib/BladeOne.php";


$views = __DIR__ . '/views';
$compiledFolder = __DIR__ . '/compiled';
$blade=new BladeOne($views,$compiledFolder,BladeOne::MODE_DEBUG);

$blade->if('isnegative', function ($value) {
    return (
$value<0);
});

$blade->if('isequals', function ($value,$value2) {
    return (
$value==$value2);
});

try {
    echo
$blade->run("Test3.customif", array('i' => 5,'e' => -5));
} catch (
Exception $e) {
}