CodeIgniter - Calling a function from inside a view

后端 未结 7 1482
长情又很酷
长情又很酷 2021-01-06 13:25

Is it possible to call a function which is located in a controller from a view?

This is what i have in my controller, as an example

function checkKey         


        
相关标签:
7条回答
  • 2021-01-06 14:27

    Controller:

    public function xyz(){
       $data['controller'] = $this;
       $this->load->view('your_view_file',$data);
    }  
    

    View:

    $controller->xyz();
    
    0 讨论(0)
提交回复
热议问题