Libraries in subfolders |
[eluser]Dave Stewart[/eluser]
I've tried this, and it appears not to work. Is this the case? Cheers, Dave
[eluser]xwero[/eluser]
There are contributions to patch this. So you are right it doesn't work maybe the load->model path code snippet should be made into a function and put into the codeigniter/common.php file to make it available for all loaded files to use Code: last_mile_path($path)
[eluser]Dave Stewart[/eluser]
I'm sure if there were collisions in names, CI coudl also warn you, or ask you to specify a different name when loading the library, ie: Code: $->this->load->library('nav/navigation','nav'); As it is, I'll cope without.
[eluser]xwero[/eluser]
Good remark i'm going to keep it in mind. I'm busy coming up with code to remove the hardcoded paths and the function i added above gives developers a greater flexibility putting CI related files.
[eluser]Dave Stewart[/eluser]
Sounds useful. xwero, are you one of CI's core developers?
[eluser]xwero[/eluser]
No i'm a developer with a short attention span And because i'm working with CI i try to find ways to make it better, but if they would pay me for my suggestions i wouldn't say no
[eluser]Dave Stewart[/eluser]
[quote author="xwero" date="1214937978"]No i'm a developer with a short attention span [/quote] Gotcha! I think that would cover me as well - it's certainly rewarding to aim for elegance. Are you extending the CI_Loader class then?
[eluser]xwero[/eluser]
At the moment i've made a MY_Common.php and a MY_Loader.php file for testing purposes. i'm going to release them soon. I'm already testing it at the moment on a site in development.
[eluser]codex[/eluser]
[quote author="xwero" date="1214936259"]Good remark i'm going to keep it in mind. I'm busy coming up with code to remove the hardcoded paths and the function i added above gives developers a greater flexibility putting CI related files.[/quote] Does this by any chance mean you're modifying the loader in a way that it will allow you to put files anywhere you want? Thus making it possible to move shared libraries/helpers into a 'shared resources' folder? I saw you had a feature request asking for just that. Would be pretty handy. EDIT: this thread http://ellislab.com/forums/viewthread/75217/ |
Welcome Guest, Not a member yet? Register Sign In |