PHP Classes

File: docs/Features/Default replacements.md

Recommend this page to a friend!
  Packages of Rafa Rodriguez   Div PHP Template Engine   docs/Features/Default replacements.md   Download  
File: docs/Features/Default replacements.md
Role: Example script
Content type: text/markdown
Description: Example script
Class: Div PHP Template Engine
Template processing engine that replaces tags
Author: By
Last change:
Date: 4 months ago
Size: 540 bytes
 

Contents

Class file image Download

Replace some values for another values.

Syntax in PHP

<?php
	
div::setDefault($value_to_search, $replace_with);

	

Syntax in templates


{@ [value_to_search, replace_with] @}

Example

index.php

<?php
	
div::setDefault(true, "YES");
	
echo new div("index.tpl", [
		"haveproducts" => true,
		"havemoney" => false
]);

index.tpl

{@ [false, "NO"] @}
	 
Have products: {$haveproducts}
Have money: {$havemoney}

	

Output


Have products: YES
Have money: NO

[[Default replacement for a variable]]