Call a controller from another controller

2019-09-17 19:19发布

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条回答
手持菜刀,她持情操
2楼-- · 2019-09-17 20:13

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();

查看更多
登录 后发表回答