Modular Extensions - Version 4.3 |
[eluser]dfau[/eluser]
Hi wiredesignz, Thanks for the new version - I've dropped .18 into my testing app and I get: Code: Unable to locate the requested file: ../application/views/foobar/one.php My master controller (application/controllers/welcome.php): Code: class Welcome extends Controller { My module (application/modules/foobar/controllers/foobar.php): Code: class Foobar extends Controller { My module's view for function "one" (application/modules/foobar/views/one.php): Code: <p>This is: /modules/foobar/views/one.php</p> It looks like the search paths have gone funny - here is the debug that I put into modules_helper.php: Code: diff --git a/application/helpers/modules_helper.php b/application/helpers/modules_helper.php Code: looking for autoload path=welcome base=config/ subpath=welcome The last two searches include paths "../application/modules/modules/config", "../application/modules/modules/views" and "../application/modules/modules/views/foobar" which don't look right, and there is no "../application/modules/foobar/views" which is where the view lives. If you could have a look at this that would be grouse. Thanks, df
[eluser]wiredesignz[/eluser]
Yes thanks again dfau Version 4.1.19 is on the wiki now. Bugfix for path searches.
[eluser]dfau[/eluser]
Hi wiredesignz, Thanks for the quick fix. If you're interested: Quote:Test app: master controller, one module, one call from master to module, autoload database library, file and url helpers5k saving, fantastic stuff. Thanks again, df
[eluser]wiredesignz[/eluser]
Version 4.1.20 is available on the wiki now. Refactoring code to improve speed and reduce memory usage. Note* $this->load->contoller(); is now replaced with $this->load->module();
[eluser]sophistry[/eluser]
just poking deeper into the code today... the MY_Router.php file has some unfamiliar code style. could you explain a few lines: Code: function _validate_request($segments) two lines i am curious about, the first line, what does this construction do? is it some kind of shortcut that works like an if statement because of the order of execution of the boolean? Code: ( ! isset($segments[1])) AND $segments[1] = 'index'; also is this the same technique (boolean evaluation order)? what is ($home) doing there? Code: /* set the module home */ Code: $config['subclass_prefix'] = 'MY_'; thanks wired.
[eluser]Alex.[/eluser]
[quote author="sophistry" date="1212612526"] two lines i am curious about, the first line, what does this construction do? is it some kind of shortcut that works like an if statement because of the order of execution of the boolean? Code: ( ! isset($segments[1])) AND $segments[1] = 'index'; Yes, pretty much. It's almost exactly the same as: Code: if(!isset($segments[1])){ Quote:also is this the same technique (boolean evaluation order)? what is ($home) doing there?If the variable $home evaluates to true, then the function path() stores the value of $home as the path. Else, it stores the value of $file as the path. You could say it is the same as : Code: if($home){ Quote:finally, in the same line shouldn't my_router::path() class function utilize the CI config setting in config.php:I'm confused - are saying that the name of the class should be dependent on the subclass prefix in the config file? If you change the value of $config['subclass_prefix'], then you will have to change all references to the my_ extension manually.
[eluser]wiredesignz[/eluser]
Thanks Alex, nice explanation Yes, using my_router calls is an oversight, it will conflict with changes to subclass_prefix and should be noted in the docs.
[eluser]Sam Dark[/eluser]
I'm back into HMVC again. Good to see initial idea grew into the powerful lib. Now about a bad thing… I have a problem loading views in v. 4120. Got this error: Code: Unable to load the requested file: list.php my app structure: Code: app/modules/files/ controllers/files.php Code: class Files extends Controller { Tried to put list.php into app/views/ and it works
[eluser]wiredesignz[/eluser]
Works for me Sam. Try using the constructor parent::Controller(); so the module can find out where it lives.
[eluser]Sam Dark[/eluser]
Tried parent::__construct() but it doesn't helped. btw, I'm trying to launch module directly with http://localhost/files/. |
Welcome Guest, Not a member yet? Register Sign In |