Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 293 | All time: 7,480 This week: 660 |
Version | License | PHP version | Categories | |||
pxml 1.0 | MIT/X Consortium ... | 5.0 | XML, PHP 5, Templates |
Description | Author | |
This class is a template engine that compiles XML like tags in PHP code. |
<img src="http://placehold.it/500/146/fff/&text=PXML" /> <br /> A smart tiny and lightest OO php templating system . <br /> Only it replaces some words with others ( uses "str_ireplace()" ) . <br /> - No regex . <br /> - No complex code . <br /> - Very light (the lightest) . <br /> - Write php as xml/html . <br /> - Self Container for ( vars & methods ) . <br /> - Object Oriented . <br />
*
Config it:
<?php
// load it
require_once 'path/tp/pxml.php';
// start it
$pxml = new pxml;
// ad your own replacements ?
$pxml->add(array(
'(php):' => ' <?php ',
':(php)' => ' ?> '
));
// render a file (and pass vars "optional")
$pxml->render('path/to/file.html', array('var' => 'value'));
An PHTML file
<h1> <print>$c</print> </h1>
<php> $this->alert = 'hi' </php>
<print> $this->alert </print>
<br />
<php> $array = array( 1,2,3,4 ); </php>
<foreach> $array as $v </foreach>
<print> $v </print>
</endforeach>
<br />
<php> $array = array( 1,2,3,4 ); </php>
<if> !empty($xxx) </if>
<print> "HI 1" </print>
<elseif> !empty($yyyy) </elseif>
<print> "HI 2" </print>
<else>
<print> "HI 3" </print>
</endif>
<br />
<for>$i=0; $i <= 5; ++$i</for>
<print>$i</print>
</endfor>
<br />
<php>$x = 4</php>
<while>$x < 5</while>
<print>$x, " - " , "HI"</print>
<php>++$x</php>
</endwhile>
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.