2015-12-02 21 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

回答

相關問題