Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - Version 4.3
#91

[eluser]Avatar[/eluser]
Quote:@wiredesignz
The to_string function you posted is not needed by the Modules helper for it to operate, I suggest you put it in your own helper. Thanks

ok, I understand now. The functions it the helper are essential for it to work, but the to_string function is not. and is only usable for nested sibling modules and that is not really needed anyway since it just complicates everything in code and in memory usage, etc... although, nesting at least one level down is a good option to have when you want to keep module intact. Thank you. I wish someone had slapped that across my forehead earlier. Smile
#92

[eluser]marios[/eluser]
I believe there is an error with version 4.09

in class Loader

$this->_path = get_class($module);

should be

$this->_path = strtolower(get_class($module));

After upgrading I was getting the error: could not load view and the path uses the module name capitalized. Unless something changed in the way to name module classes and directory names.
#93

[eluser]wiredesignz[/eluser]
Did that fix your error?

In Windows it should not matter, and in Linux only the class names are Capitalised the actual objects are lowercase versions.
#94

[eluser]marios[/eluser]
it is a linux system.

here is how i have my structure:

Code:
modules
  head
    controllers
       head.php
    views
       head_view.php

head class name is Head.

and i get this error:
Unable to locate the requested module file: Head/views/head_view.php

if i rename the folder to Head i get this error:
Unable to locate the requested module file: head/controllers/head.php

so it seems the controller uses the lower case and the view the upper case.

if i modify the Loader class to use strtolower() it works fine.
#95

[eluser]wiredesignz[/eluser]
The loader tries finding lowercase and then uppercase names for all files just in case.

The module and its controller generally have the same name, modules/header/controllers/header.php although it isn't compulsory.

But yes, the head.php would create a `Head` class, I will add this fix to 4..0.10 Thanks marios Wink
#96

[eluser]marios[/eluser]
so was my naming for the folders and modules and the class name the way HMVC expects it?
I noticed the previous version had the strtolower() so i wasn't sure if it was removed for a specific reason.
#97

[eluser]wiredesignz[/eluser]
It was removed because I felt it wasn't needed, I forgot Linux has filename constraints, I will fix that. Thanks.
#98

[eluser]wiredesignz[/eluser]
Version 4.0.10 is available on the wiki
Altered file loading: Modules now know which is their home directory.
#99

[eluser]wiredesignz[/eluser]
Version 4.0.11 is available on the wiki
Improved module file scanning

[eluser]Avatar[/eluser]
in wiki still points to 4010. please update.




Theme © iAndrew 2016 - Forum software by © MyBB