Stop execution after call $this->load->view()

后端 未结 5 982
野性不改
野性不改 2021-01-18 01:40

In Codeigniter, How could we stop the execution after load a view?

I have tried this

function index() {
    $this->load->view(\'myView\');
             


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-18 02:12

    You should call load->view at the end of your controller method. If you stop execution then other parts of the theme will not be loaded. Your view file contents will only be rendered. You can use this method for ajax calls where you do not want any thing else should be rendered except what you want to render as out put of ajax call.

提交回复
热议问题