Source for file load_templates.php
Documentation is available at load_templates.php
* Loads sub-templates contained in an external file
* * file : the resource name of the file to load
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://dwoo.org/LICENSE Modified BSD License
if (preg_match('#^([a-z]{2,}):(.*)$#i', $file, $m)) {
// resource:identifier given, extract them
// get the current template's resource
$resource =
$compiler->getDwoo()->getTemplate()->getResourceName();
$tpl =
$compiler->getDwoo()->templateFactory($resource, $identifier);
} elseif ($tpl ===
false) {
$cmp->compile($compiler->getDwoo(), $tpl);
foreach ($cmp->getTemplatePlugins() as $template=>
$args) {
$compiler->addTemplatePlugin($template, $args['params'], $args['uuid'], $args['body']);
foreach ($cmp->getUsedPlugins() as $plugin=>
$type) {
$compiler->addUsedPlugin($plugin, $type);
$out =
'\'\';// checking for modification in '.
$resource.
':'.
$identifier.
"\r\n";
$modCheck =
$tpl->getIsModifiedCode();
$out .=
'if (!('.
$modCheck.
')) { ob_end_clean(); return false; }';
$tpl = $this->templateFactory("'.
$resource.
'", "'.
$identifier.
'");
} catch (Dwoo_Exception $e) {
$this->triggerError(\'Load Templates : Resource <em>'.
$resource.
'</em> was not added to Dwoo, can not extend <em>'.
$identifier.
'</em>\', E_USER_WARNING);
$this->triggerError(\'Load Templates : Resource "'.
$resource.
':'.
$identifier.
'" was not found.\', E_USER_WARNING);
$this->triggerError(\'Load Templates : Resource "'.
$resource.
'" does not support extends.\', E_USER_WARNING);
if ($tpl->getUid() != "'.
$tpl->getUid().
'") { ob_end_clean(); return false; }';
Documentation generated on Sun, 07 Feb 2010 17:53:51 +0000 by phpDocumentor 1.4.0