Modular Separation - PHP5 (Modules) |
[eluser]dfreerksen[/eluser]
I'm having a horrible time getting hooks to pull things from the config file. $CI =& get_instance(); $blah = $CI->config->item('base_url'); Will display an error on the page Fatal error: Call to a member function item() on a non-object in ...
[eluser]Phil Sturgeon[/eluser]
[quote author="dfreerksen" date="1271280854"]I'm having a horrible time getting hooks to pull things from the config file. $CI =& get_instance(); $blah = $CI->config->item('base_url'); Will display an error on the page Fatal error: Call to a member function item() on a non-object in ...[/quote] That is nothing to do with Modular Separation so this was a weird place to post your request. What hook point are you using, as that makes a massive difference to what is available. You might need to use $config =& load_class('Config'); if it is pre_controller.
[eluser]dfreerksen[/eluser]
I posted it here because it was working before I started using the Modular Separation. It worked both with and without HMVC. I thought it might be something with Modular Separation. I moved the hook for pre_controller to post_controller_constructor and it's working fine.
[eluser]All hail ci[/eluser]
greetings for all. first of all, please apologize me for my bad-structured English. i'm getting an error from loading more than one library when using Module Separation. usually, i load a few libraries like this: Code: $this->load->library(array('session', 'table')); Code: A PHP Error was encountered if I load the libraries 'one-by-one', it works: Code: $this->load->library('session'); anybody know how to fix this? i've tried searching it, but no clues. i'm using Codeigniter 1.7.2. if there's a similar post, could you please pinpoint me to it? thanks a lot before. ![]()
[eluser]jonldavis[/eluser]
This looks like exactly what I need, as I'm setting up a web site consisting of a large number of "applications" (modules). I have a question about suggested best practice for routing, since routes can be altered either in application/config or in application/modules/myapp/config. Is it a good idea to include ANY module-specific routes in the main routes.php (perhaps to point CI to the appropriate controller), or put all the routing in the module-specific configs. My initial inclination is to move it all into the modules, so maybe the real question is: is it possible to do all the routing from the modules? My main index.php is basically nothing more than a menu for the various modules. Any thoughts or comments would be welcome -- I don't expect everyone will agree on a single answer.
[eluser]Phil Sturgeon[/eluser]
[quote author="All hail ci" date="1271428955"] i'm getting an error from loading more than one library when using Module Separation. usually, i load a few libraries like this: Code: $this->load->library(array('session', 'table')); Code: A PHP Error was encountered if I load the libraries 'one-by-one', it works: Code: $this->load->library('session'); I've added support for that, lets call it v1.12. [quote author="jonldavis" date="1271816235"]This looks like exactly what I need, as I'm setting up a web site consisting of a large number of "applications" (modules). I have a question about suggested best practice for routing, since routes can be altered either in application/config or in application/modules/myapp/config. Is it a good idea to include ANY module-specific routes in the main routes.php (perhaps to point CI to the appropriate controller), or put all the routing in the module-specific configs. My initial inclination is to move it all into the modules, so maybe the real question is: is it possible to do all the routing from the modules? My main index.php is basically nothing more than a menu for the various modules.[/quote] Routing within modules is not the same as routing at a global level. In the main routes.php you are setting the entire route, but within a module you are setting where requests already mapped to that module shout be routed to. Tricky to explain, hope you understand that.
[eluser]All hail ci[/eluser]
Hi, Phil Sturgeon. 'Pagination' library doesn't work correctly when i put my application inside modules directory. for instances, i have 4 records on a table. i want to view them separately into 2 pages with 2 records each. Code: $config['base_url'] = base_url()."mod_usermanager/usermanager/show_users"; the links for the second page should change or become unclickable, but it's not! and the links for the 1st page is unclickable. any solution for this?? or am I missing something? i didn't get this kind of problem when i put my application outside the modules directory.
[eluser]Johan André[/eluser]
Try the $config['uri_segment'] setting it to the correct value. Since your url is: mod_usermanager/usermanager/show_users it should be set to 4.
[eluser]All hail ci[/eluser]
[quote author="Johan André" date="1272320678"]Try the $config['uri_segment'] setting it to the correct value. Since your url is: mod_usermanager/usermanager/show_users it should be set to 4.[/quote] It Works! :lol: haha.. thanks a lot, Johan André. i'm sorry for missing this little thing. |
Welcome Guest, Not a member yet? Register Sign In |