Call a controller from another controller

China☆狼群 提交于 2019-12-12 02:35:20

问题


I want to call another controller, I have these two

Ajax_controller

.
.
.
public function download_low_image($image){
$file = $this -> mimages -> get_image_file($image);
$test = new Thumb_controller();
$test->crop();

}

But returns

Unable to locate the specified class: Session.php

How can fix this?


回答1:


may be this will help to solve your problem. generallly , you can load other controller as

  1. Load Controller inside your controller like

    $this->load->library('../controllers/Thumb_controller');

  2. then simply call the method

    $this->Thumb_controller->functioname();



来源:https://stackoverflow.com/questions/38699299/call-a-controller-from-another-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!