1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

question about Title.php

Discussion in 'XenForo Questions and Support' started by typostudy, Apr 26, 2013.

Thread Status:
Not open for further replies.
  1. typostudy

    typostudy Member

    Code:
    <?php
     
    /**
    * Class to handle compiling template tag calls for "title".
    *
    * @package XenForo_Template
    */
    class XenForo_Template_Compiler_Tag_Title implements XenForo_Template_Compiler_Tag_Interface
    {
        /**
        * Compile the specified tag and return PHP code to handle it.
        *
        * @param XenForo_Template_Compiler The invoking compiler
        * @param string                Name of the tag called
        * @param array                  Attributes for the tag (may be empty)
        * @param array                  Nodes (tags/curlies/text) within this tag (may be empty)
        * @param array                  Compilation options
        *
        * @return string
        */
        public function compile(XenForo_Template_Compiler $compiler, $tag, array $attributes, array $children, array $options)
        {
            if (empty($options['allowRawStatements']))
            {
                throw $compiler->getNewCompilerException(new XenForo_Phrase('x_tags_only_used_where_full_statements_allowed', array('tag' => 'title')));
            }
     
            $var = '__extraData[\'title\']';
            $childOutput = $compiler->compileIntoVariable($children, $var, $options, false);
     
            return $compiler->getNewRawStatement($childOutput);
        }
    }
    Above code is taken from: library\XenForo\Template\Compiler\Tag\Title.php,
    I am just thinking how does it work? eg.
    Code:
    <xen:title>Page Title</xen:title>
    So is XenForo_Template_Compiler $compiler=xen? $tag=title? $attributes=Page Title?
     
  2. Mike

    Mike XenForo Developer Staff Member

    I'm only doing this as I've seen you post here a number of times. The questions/support forum isn't the correct location for dev questions. There are development forums you should post these questions in.
     
Thread Status:
Not open for further replies.

Share This Page