PHP Classes

File: examples/examplerelative.php

Recommend this page to a friend!
  Classes of Jorge Castro   BladeOne   examples/examplerelative.php   Download  
File: examples/examplerelative.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.47.3 see changelog.
* 3.47.2 see changelog.
Date: 2 years ago
Size: 1,063 bytes


Class file image Download
use eftec\bladeone\BladeOne;

if (!isset(
$flag)) {
"you should call <a href='relative1/relative2/callrelative.php'>relative1/relative2/callrelative.php</a>");


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

// It is an example, usually baseurl is a fixed value
// However, in this example, we are faking a fixed value by obtaining a value and removing the relative path and parameters
$fullurl=str_replace('relative1/relative2/callrelative.php', '', $fullurl);
$arr=explode('?', $fullurl);

$blade->run("relative.relative", ['baseurl'=>$blade->getBaseUrl()]);