Modular Separation - PHP5 (Modules) |
[eluser]Zandy[/eluser]
@wiredesignz : also tried to change uri_protocol and nothing ....
[eluser]wiredesignz[/eluser]
[quote author="Zandy" date="1256841092"]@wiredesignz : my default controller in routes.php is "welcome".... ($route['default_controller'] = "welcome"[/quote] Yes but now you have no welcome controller so the default_controller setting is incorrect. The controller has become the mymodule/welcome controller! Modules function almost like sub-directories would normally, I recommend you check the CodeIgniter user guide.
[eluser]Zandy[/eluser]
Works but ... if I add a module called "truck" and put inside a controller called "ford", by placing the following uri http://localhost/ci_test/index.php/truck/ford and.... the default controller runs... ? not ford controller. multiple modules support ??? my actual struct folder. Quote:modules ever runs default controller..! thank @wiredesignz :-)
[eluser]Milos Dakic[/eluser]
Can a module have a config folder for its own settings? I wanted to know since I want to use a single route.php file per module, that way each module has its own route settings.
[eluser]wiredesignz[/eluser]
Yes modules may contain a config/routes.php file. The main difference from application routes, is that you set a default controller for a module like so: Code: $route['module'] = 'controller';
[eluser]goran_zg[/eluser]
Sorry for this question, but what is the real difference between HMVC and this. If I only need to use modules not to have them in hierarchical order(not been able to get data from child to parent) this would be better? how much is the performance difference? anyway, great work, smth like this or this should really be in next CI release
[eluser]wiredesignz[/eluser]
[quote author="goran_zg" date="1258010483"]... If I only need to use modules not to have them in hierarchical order ... this would be better ...[/quote] You are 100% correct. Thanks for explaining.
[eluser]goran_zg[/eluser]
Sorry for another question. I installed it on my CMS. And I get error: A PHP Error was encountered Severity: Notice Message: Undefined property: Frontend::$MFrontend Filename: controllers/frontend.php Line Number: 35 This is before I even separate my code in modules. In the line I call some method from model $this->MFrontend->getMenuItem(.....); the same goes on every controller... please help, thnx EDIT, just to add php_error.log line for the try. [12-Nov-2009 19:15:39] PHP Fatal error: Call to a member function getMenuItem() on a non-object in /Applications/MAMP/htdocs/webox/application/controllers/frontend.php on line 35 Hope it helps couse I really want to use this module approach.
[eluser]wiredesignz[/eluser]
@goran_zg, Read the codeigniter user guide regarding naming conventions and when not to use CamelCase! Modular Separation requires that you use these naming conventions also.
[eluser]goran_zg[/eluser]
Idiot me, I wrote the whole cms wrong...... Now pain work, and testing then thnx EDIT Just corrected some function and this looks and works great really Ok, another stupid q. I have a template.php file in normal view/folder it contains basic html and calls $this->load->view(smth); and $this->load->view($main); // this is variable what lets say screen to load and I think it looks in folder of template not modules for file defined in there how can I make it look in modules/../view for that. thnx |
Welcome Guest, Not a member yet? Register Sign In |