CodeIgniter Forums
Autoloading... can you pass parameters to the constructor? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Autoloading... can you pass parameters to the constructor? (/showthread.php?tid=10328)



Autoloading... can you pass parameters to the constructor? - El Forum - 07-27-2008

[eluser]Unknown[/eluser]
I have a little session class that I use for shared hosting accounts, as it makes session identifiers unique. The way this function is written, is that it is passed a unique token when being constructed. Given the fact that I'll be reusing it throughout my application, I figured autoloading made the most sense. I can load the class just fine, but I'm unsure how I could pass parameters to my constructor.

Is this possible? If not, are there any workarounds?


Autoloading... can you pass parameters to the constructor? - El Forum - 07-27-2008

[eluser]Tom Glover[/eluser]
You can Extend the default controller with repeated functions, in the libraries folder. you then call your controller in which to extend in the normal way.

This allows you to have repeated controller calls, with out the use of wick.

There is an example of this in BackEnd Pro. Hope this helps you find what you are looking for.