PHP Classes

File: examples/testlang2019.php

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

Contents

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

include "../lib/BladeOne.php";
include
"../lib/BladeOneLang.php";
use
eftec\bladeone\BladeOne;
use
eftec\bladeone\BladeOneLang;

$views = __DIR__ . '/views';
$compiledFolder = __DIR__ . '/compiled';



$blade=new BladeOne($views, $compiledFolder);


$blade->missingLog='c:\temp\missingkey.txt'; // if a traduction is missing the it will be saved here.

$lang='jp'; // try es,jp or fr
include __DIR__.'/lang2/'.$lang.'.php';



//<editor-fold desc="Example data">


try {
    echo
$blade->run("Lang.test", ['var'=>'1']);
} catch (
Exception $e) {
    echo
"error found ".$e->getMessage()."<br>".$e->getTraceAsString();
}


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