簡體   English   中英

在另一個函數中調用控制器的索引函數

[英]Calling index function of a controller in another function

我在創建調用函數(索引函數)的函數時遇到問題。 為了便於理解,讓我解釋一下:

class My_Controller extends CI_Controller{
    public function index(){
        echo 'This is index function';
    }

    public function calling_index(){
        // doing what's inside the index() function
    }
}

有什么建議嗎?

使用不會有問題

$this->index() 

因為控制器只是一類

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM