PHPTal

PHPTal-related stuff
(See also: Skins)

Implements the elegant zope page template syntax (well-formed xml) in php. Provides advanced features such as
 * metal: slots
 * i18n (including GetText integration and automatic message catalogue extraction)
 * template can be validated directly with the w3c validator, xml syntax error are displayed on first execution

http://phptal.sourceforge.net/ http://phptal.sourceforge.net/bagpack/HTML_Template_PHPTAL/doc/phptal.whyusingit.html

Sample template:
template:   place for the page title sample title Sample Sitetitle Sample Content text

parsed php (template is parsed once after a change, afterwards just the php version is used- same as with smarty): getContext; $__out__ = new PHPTAL_OutputControl($__ctx__, $__tpl__->getEncoding); $__ctx__->set("repeat", array); if (! $__tpl__->_headers) { $__tpl__->_headers = ' ';   }    $__out__->writeStructure('   '); // TAG title AT LINE 4 $_src_tag = "title"; $_src_line = 4; $temp_0 = $__ctx__->get("title"); $__out__->write($temp_0); $__out__->writeStructure('  '); // TAG h1 AT LINE 9 $_src_tag = "h1"; $_src_line = 9; $temp_1 = $__ctx__->get("title"); $__out__->write($temp_1); $temp_3 = "sitetitle"; $__out__->writeStructure('  '); $temp_2 =& $temp_3; $__out__->pushBuffer; $__out__->writeStructure('Sample Sitetitle'); $__out__->popBuffer; $__out__->writeStructure($__tpl__->_translate($temp_2)); $__out__->writeStructure('  '); // TAG div AT LINE 11 $_src_tag = "div"; $_src_line = 11; $temp_4 = $__ctx__->get("bodytext"); $__out__->writeStructure($temp_4); $__out__->writeStructure(' '); return $__out__->toString; } ?>