Welcome Guest, Not a member yet? Register   Sign In
Codeigniter library: autoload and params
#1

[eluser]AFRC[/eluser]
Hi,

I've coded a library, and used to pass some params to it through controllers. No problem.
Since i've autoloaded this library i'm unable to request the params.

Any ideas how to solve this?

Thanks.
#2

[eluser]theprodigy[/eluser]
one of two ways:

1) add a config method, and move the code from your constructor to the config method, and pass your params to the config method.

2) don't autoload it. Instead, build a MY_Controller, and load your library via the constructor of your MY_Controller, and pass in the params. Then extend all your controllers from your MY_Controller.




Theme © iAndrew 2016 - Forum software by © MyBB