PHP Classes

File: plugin/if.php

Recommend this page to a friend!
  Classes of bassam alessawi  >  Sfhati PHP engine  >  plugin/if.php  >  Download  
File: plugin/if.php
Role: Auxiliary script
Content type: text/plain
Description: Class source
Class: Sfhati PHP engine
Template engine that generates PHP compiled files
Author: By
Last change:
Date: 7 years ago
Size: 392 bytes
 

Contents

Class file image Download
<?php
/*
  use like [if:"expr","statement"end if]
  or like [if:"expr","statement [else] statement"end if]
 */

function if_SYNTAX($vars) {
    global
$syntaxcode;
    foreach (
$vars as $v => $var) {
       
$vars[$v] = $syntaxcode->Syntax($var);
    }
   
$vars[1] = str_replace('[else]', "<?php }else{ ?>", $vars[1]);
    return
"
   <?php if (
$vars[0]) { ?>
 
$vars[1]
<?php } ?>
"
;
}