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

Not a Bug XenForo_Template_Abstract::_renderInternal has useless parameter

Discussion in 'Resolved Bug Reports' started by tyteen4a03, Jul 8, 2013.

  1. tyteen4a03

    tyteen4a03 Well-Known Member

    EDIT: Actually, I see how the workflow works now. I would have made _renderInternal return an array, but to each their own.

    Oh well. Mods can move this as Not a Bug.

    I was digging through the code to answer this question when I came across that function.

    Here is the render function:

        public function render()
            $__template = $this->_loadTemplate($this->_templateName);
            if ($__template === '')
                return '';
            set_error_handler(array($this, 'handleTemplateError'));
            $this->_templateErrors = array();
            $__output = $this->_renderInternal($__template, $__extraData);
            XenForo_CodeEvent::fire('template_post_render', array($this->_templateName, &$__output, &$__extraData, $this), $this->_templateName);
            if (is_array($__extraData) && !empty($__extraData))
            blah blah blah...
    Here is the _renderInternal function:

        protected function _renderInternal($__template, &$__extraData)
            $__params = $this->_params; // special variable for dumping purposes
            $__output = '';
            $__extraData = array();
            if ($this->_usingTemplateFiles())
                if (file_exists($__template))
            return $__output;
    If you track the workflow of render(), $__extraData is never defined (except if maybe you're in the installer). Also, in _renderInternal, $__extraData gets manually set to an empty array. Hence, _renderInternal's extra parameter $__extraArray is not needed.

Share This Page