CodeIgniter view loading not loading in order?

前端 未结 4 1152
生来不讨喜
生来不讨喜 2021-01-25 14:57

I have a Controller in CodeIgniter with the following code:

$this->load->view(\"first\");
echo \"LOL\";
$this->load->view(\"second\");
4条回答
  •  天命终不由人
    2021-01-25 15:42

    Here's a more elegant way to do this:

    $this->load->view("first");
    $this->output->append_output("LOL");
    $this->load->view("second");
    

    Using this will reduce rewrites of pre-written $this->load->view statements into echos. Hope it helps.

提交回复
热议问题