• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a function after controller method

Hello Igniters,

i've been using CI for some time and to be honest i really like it. Now i use it as a base on all my application.

There has been something that i've been strugling with for a while. I want to call a method which is defined in my controller class ( extended base controller ) after every execution of a controller method. Thats because i make a lot of simple sites and i want to minimize the size of the code in there.

I know there are hooks. Using it you can execute a class method on post_controller point. You should enter there Class and method name which is not exactly what i want.. I want to be able to execute a member function of the current controller.

A possible solution might be to make a class which gets instance so it gets access to the current CI resources and execute this "destructor" but it doesnt seem quite right.

I will appreciate any suggestions!

Thanks for your time Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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