Deutschland United States United Kingdom
ContentLion - Open Source CMS

internalcompileprivatechildblock.php

Blame | Last modification | View Log

<?php
/**
 * Smarty Internal Plugin Compile Child Block Class
 *
 * @package Smarty
 * @subpackage Compiler
 */

class Plugin_Smarty_InternalCompilePrivateChildBlock extends Plugin_Smarty_InternalCompileBase
{

    /**
     * Attribute definition: Overwrites base class.
     *
     * @var array
     * @see Plugin_Smarty_InternalCompileBase
     */

    public $required_attributes = array('name', 'file', 'uid', 'line');


    /**
     * Compiles code for the {private_child_block} tag
     *
     * @param array $args     array with attributes from parser
     * @param object $compiler compiler object
     * @return boolean true
     */

    public function compile($args, $compiler)
    {
        // check and get attributes
        $_attr = $this->getAttributes($compiler, $args);

        // must merge includes
        if ($_attr['nocache'] == true) {
            $compiler->tag_nocache = true;
        }
        $save = array($_attr, $compiler->nocache);

        // set trace back to child block
        $compiler->pushTrace(trim($_attr['file'], "\"'"), trim($_attr['uid'], "\"'"), $_attr['line'] - $compiler->lex->line);

        $this->openTag($compiler, 'private_child_block', $save);

        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
        $compiler->has_code = false;

        return true;
    }
}