PHP Classes

File: examples/testincludeif.php

Recommend this page to a friend!
  Classes of Jorge Castro  >  BladeOne  >  examples/testincludeif.php  >  Download  
File: examples/testincludeif.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/testincludeif.php
Date: 1 month ago
Size: 1,069 bytes
 

 

Contents

Class file image Download
<?php
/**
 * Copyright (c) 2016 Jorge Patricio Castro Castillo MIT License.
 */

use eftec\bladeone\BladeOne;

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


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


//<editor-fold desc="Example data">
$name="New User";
$records=array(1,2,3);
$users=array();
$usr=new stdClass();
   
$usr->id=1;
   
$usr->name="John Doe";
   
$usr->type=1;
   
$usr->number=1;
$users[]=$usr;
$usr=new stdClass();
   
$usr->id=2;
   
$usr->name="Anna Smith";
   
$usr->type=2;
   
$usr->number=5;
$users[]=$usr;

$drinks7=array('Cocacola','Pepsi','Fanta','Sprite','7up');
$drinks8=array('Cocacola','Pepsi','Fanta','Sprite','7up','Bilz&Pap');
//</editor-fold>





try {
    echo
$blade->run("if.if"
       
, ["some_var" => "some_var"]);
} catch (
Exception $e) {
    echo
$e->getMessage();
}

/*
echo $blade->run("Test.hello"
    ,["name"=>"hola mundo"
        ,'records'=>$records
        ,'users'=>$users
        ,'drinks7'=>$drinks7
        ,'drinks8'=>$drinks8]);
*/


For more information send a message to info at phpclasses dot org.