File: examples/example_composer2.php

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

Contents

Class file image Download
<?php

/**
 * Copyright (c) 2020 Jorge Patricio Castro Castillo MIT License.
 */

use eftec\bladeone\BladeOne;

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


$bladeOne=new BladeOne(__DIR__.'/views', __DIR__.'/compiles',BLADEONE::MODE_DEBUG);

$bladeOne->composer('exampleextends.layout', function ($view) {
   
$view->with([
       
'header' => "IT IS THE HEADER",
       
'footer' => "IT IS THE FOOTER",
    ]);
});
$bladeOne->composer('exampleextends.example2', function ($view) {
   
$view->with([
       
'content' => "IT IS THE CONTENT"
   
]);
});




echo
$bladeOne->run('exampleextends.example2');


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