• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get current conroller/controller-function inside a library

[eluser]Ebot Ndip-Agbor[/eluser]
What I want to do is get the controller and controller function that called the library i am using. Something like this
class Some_controller extends Controller  {

  function some_function()

I want to get some_controller/some_function within the library to use for a redirect.

N.B: Didnt want to use
incase the controller in question is set as default controller in the routes file.
Thought of passing it as a parameter to the library :roll:. Need some insight please.

// pass data to the library constructor
$this->load->library('a_library', 'controller_name_and_method');

// pass the object to the library constructor
$this->load->library('a_library', $this);

[eluser]Ebot Ndip-Agbor[/eluser]
That does not solve my problem. I want to know the controller/controller-method that called the library. I guess the only way to achieve this will be to pass the current controller/controller-method as parameter to the library when calling it.

If you say so Tongue

[eluser]Ebot Ndip-Agbor[/eluser]

Thanks for posting by the way.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.