Welcome Guest, Not a member yet? Register   Sign In
Short object name for a model on autoload file
#1

[eluser]Arun Joshi[/eluser]
Hello

We can add a short object name for a model when we load it, like
Code:
$this->load->model('Usermanagemet_model', 'mod_user');

This is ok when we load models from controllers. Then can we add a short object name when we load it in autoload file?

Thanks
Arun
#2

[eluser]Arun Joshi[/eluser]
any idea about this?
#3

[eluser]Georgi Budinov[/eluser]
Never needed that but a fast check in the sources - seems that there is no way to do that in 1.7 at least.
You could extend the CI_Loader class and overwrite _ci_autoloader function.
#4

[eluser]cahva[/eluser]
..or use base controller technique described here:
http://philsturgeon.co.uk/news/2010/02/C...ing-it-DRY

I always use this method and I don't autoload anything but the obvious(url helper, session, database etc.).
#5

[eluser]sa3m[/eluser]
Hi, sorry to dig up this thread Smile
I posted a suggestion about this on uservoice :
http://codeigniter.uservoice.com/forums/...?ref=title
Do you think that it could solve your problem ?




Theme © iAndrew 2016 - Forum software by © MyBB