2015-12-02 46 views
1

有人可以帮助我解决这个问题。 我不知道是否可能。需要通过返回到另一个方法

我的代码

/*=================================================== 
    =   This block can't be changed   = 
    ===================================================*/ 

    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/footer.tpl')) { 
     $this->template = $this->config->get('config_template') . '/template/common/footer.tpl'; 
    } else { 
     $this->template = 'default/template/common/footer.tpl'; 
    } 

    $this->render(); // need to have same effect of "return $this->render();" 

    /*===== End of This block can't be changed ======*/ 

此块写了另外的方法来处理渲染方法:

protected function render() 
{ 
    return $this->load->view($this->template, $this->data); 
} 

我需要时调用方法render假定渲染方法相同的回报。

“$ this-> render();”需要具有“return $ this-> render();”的效果。

有人吗?

+3

...为什么你不能用'返回$这个 - >渲染();'? – Federkun

+0

@federico我无法更改该代码。更好,我可以,但我不应该, – Victor

+0

也许你只是想直接把它放?那么只需在你的渲染函数中执行echo $ this-> load-> view($ this-> template,$ this-> data);' – dev0

回答

相关问题