PHP Classes

File: examples/testingcompile.php

Recommend this page to a friend!
  Classes of Jorge Castro  >  BladeOne  >  examples/testingcompile.php  >  Download  
File: examples/testingcompile.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/testingcompile.php
Date: 11 months ago
Size: 869 bytes
 

Contents

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

use eftec\bladeone\BladeOne;

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

$blade=new BladeOne(['./views','./views2'], null, BladeOne::MODE_AUTO);


@
rename('./views/compile/compile1.blade.php.bak', './views/compile/compile1.blade.php');


    echo
$blade->run("compile.compile1", []);


rename('./views/compile/compile1.blade.php', './views/compile/compile1.blade.php.bak');

// we re-created the second compile to change the compilation time.
$content=file_get_contents('./views2/compile/compile1.blade.php');
file_put_contents('./views2/compile/compile1.blade.php',$content);

echo
$blade->run("compile.compile1", []);
/*
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.