PHP Classes

File: examples/test2b.php

Recommend this page to a friend!
  Classes of Jorge Castro   BladeOne   examples/test2b.php   Download  
File: examples/test2b.php
Role: Example script
Content type: text/plain
Description: Example script
Class: BladeOne
Standalone template engine that compiles into PHP
Author: By
Last change: 3.44.1 if the view file is not found then it shows the full path.
Date: 3 years ago
Size: 660 bytes
 

Contents

Class file image Download
<?php
/**
 * Copyright (c) 2016 Jorge Patricio Castro Castillo MIT License.
 */
include "../lib/BladeOne.php";
use
eftec\bladeone\BladeOne;

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

function
myFunction()
{
    echo
"<br>Running the function <b>myFunction()</b><br>";
}

//<editor-fold desc="Example data">
$v1=1;

try {
   
/**
     * @see examples/views/Test/hello2.blade.php
     */
   
echo $blade->run("Test.hello2", ['other' => 'hello world', 'v1' => $v1]);
} catch (
Exception $e) {
    echo
"error found ".$e->getMessage()."<br>".$e->getTraceAsString();
}