Home > Mobile >  how to use another controller function without extends in our controller
how to use another controller function without extends in our controller

Time:09-30

how to use another controller function without extends in our controller

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

already used it is giving error =

Unable to locate the specified class: Session.php

CodePudding user response:

Well you are not supposed to do that. If your controller uses repeatable logic, you should make class (Service for example), put the re-usable logic into it and call it in your controllers.

CodePudding user response:

You can't use another controller function inside the controller. You can archive this in these two ways.

  1. Create a Helper class
  2. Create a generic model.
  • Related