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

[eluser]wiredesignz[/eluser]
Modular Extensions version 4.2.06 (bugfix) is available on the wiki.

Fixed: plugin filename error. Thanks sophistry Wink

[eluser]sophistry[/eluser]
a quick question i couldn't find the answer to on the forum or the wiki...

i want to create a MY_directory_helper.php to "extend" the directory helper. When I put that file in the modulename/helper directory it does not load properly - that is, I am not able to use a new function.

i'd like to be able to provide a MY_directory_helper.php along with my module. Is this supported? Can I load MY_ style helper files (and for that matter any other MY_ type extended files)? I see on the forum the limitation with MY_Controller and how it takes over and how it shouldn't be used with ME, but I didn't find anything about helpers or other "extendable" files.

BTW, when i put MY_directory_helper.php in the application/helpers directory it works - it provides me the function i've defined in the extended file.

thx!

[eluser]wiredesignz[/eluser]
@sophistry, ME doesn't check for MY_ extensions in modules, I would consider your helper extension to be a core extension and therefore a shared file, thus locating it in application/helpers would be correct.

[eluser]sophistry[/eluser]
so, if i want to bring in a helper file into the module (and have it exist in the module directories) i should name it /modulename/helpers/whatever_helper.php and then load it up in the controller (for example)? i can load it the normal way? like this:
Code:
$this->load->helper('whatever');

i'll update the wiki to note this: "ME doesn’t check for MY_ extensions in modules"

thx.

[eluser]wiredesignz[/eluser]
Yes, module helpers are loaded in the same fashion as CI helpers, they can be autoloaded via an autoload file ie: {$module_name}/config/autoload.php or they can be autoloaded using a controller class variable

Example:
Code:
var $autoload = array('helpers' => array('form','whatever'));

[eluser]freshface[/eluser]
I installed ME and always get an 404.
I autoload the library and the 2 helpers.

This is my folder structure.


http://users.pandora.be/heyninck/screen.png

[eluser]wiredesignz[/eluser]
From the look of your screenshot you are using an old version of ME.

Download version 4.2 from the wiki.

Controller.php and MY_Router.php should be installed to application/libraries.

modules_helper.php should be in application/helpers.

debug_helper.php is optional.

CI loads the Controller and it loads everything else automatically, except debug_helper.

[eluser]freshface[/eluser]
Okay, I works!
I used 4.0 bescause it said final.

Thx Wink

[eluser]wiredesignz[/eluser]
Ok thanks. final = no longer being developed. Sorry for any confusion.

NOTE:
Download link for version 4.0 is removed from wiki to avoid future confusion.

[eluser]freshface[/eluser]
Sorry, it still doesn't work.
I had welcome.php and its view still in controllers and views

So I only need to autoload the controller?

Code:
$autoload['libraries'] = array('Controller');




Theme © iAndrew 2016 - Forum software by © MyBB