Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14356

Hooks - pre_controller vs. post_controller_constructor

$
0
0
I got two hooks. "guardian" and "orm" both of them are now starting as "post_controller_constructor" beacuse I need db connection. 
But side effect is, that I can't use Orm and Guardian methods in controller constructor because they are not loaded yet. 
And it is very anoying to write the same code in to all controller methods because I can't use constructor to put it in.

I passed through by writing method postConstructor() which is called as first in controller method. And I put repeatly used code in it. 

But I don't like this sollution. 

Does enybody have an idea how to solve this better way?

Viewing all articles
Browse latest Browse all 14356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>