PHP Classes

File: templating_engine/functions/templater_json.php

Recommend this page to a friend!
  Classes of jon   PHP Templating Engine   templating_engine/functions/templater_json.php   Download  
File: templating_engine/functions/templater_json.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Templating Engine
Process templates in PHP, JSON and CSS formats
Author: By
Last change: Update of templating_engine/functions/templater_json.php
Date: 1 year ago
Size: 812 bytes
 

Contents

Class file image Download
<?php

function templater_json($file, $r)
{
   
/*
    $file = str_replace('<ar', '<article', $file);
    $file = str_replace('<b', '<button', $file);
    $file = str_replace('<c', '<content', $file);
    $file = str_replace('<d', '<div', $file);
    $file = str_replace('</ar', '</article', $file);
    $file = str_replace('</b', '</button', $file);
    $file = str_replace('</c', '</content', $file);
    $file = str_replace('</d', '</div', $file);
    */
   
$file = str_replace('"{', '"<?= $', $file);
   
$file = str_replace('}"', '; ?>"', $file);
   
$file = str_replace('S[', '_SESSION[\'', $file);
   
$file = str_replace(']S', '\']', $file);
   
   
file_put_contents('tmp.php', $file);

   
ob_start();
    include(
'tmp.php');
   
$html = ob_get_clean();

    return
$html;
}