Welcome Guest, Not a member yet? Register   Sign In
Modular Separation - PHP5 (Modules)

[eluser]loosetops[/eluser]
dejavu, you should use a helper function to load the view.

[eluser]dejavu[/eluser]
[quote author="loosetops" date="1281065314"]dejavu, you should use a helper function to load the view.[/quote]
Thanks, but that doesn't help. What helper function???

[eluser]Johan André[/eluser]
[quote author="dejavu" date="1281119409"][quote author="loosetops" date="1281065314"]dejavu, you should use a helper function to load the view.[/quote]
Thanks, but that doesn't help. What helper function???[/quote]

I think he means that you should WRITE a helper to load the view...

[eluser]Unknown[/eluser]
[quote author="Phil Sturgeon" date="1278597037"]Whenever you see the word "any" you have to expect there to be exceptions. "any application" was referring to any normal MVC app with helpers and libraries, and extended core libraries are obviously not part of run-of-the-mill application.

MY_Controller is loaded so early on that it would be a mess to hack this in, and I can't see why or how it would be useful. You could use my Base Controller code to make a different base controller for each module if you like, but this is something I have never needed to do.

I usually move shared module logic into a library and load that in the constructor of each controller as I have never seen a module with more than 4 or 5 controllers.[/quote]

I tried to use your __autoload() method of loading a base controller for just the backend, however I didn't want this function to be in the config file, I don't think that's very clean. So I tried to put it somewhere else, but I just couldn't get it to work. When I disabled MS it suddenly worked, so I found out you use
Code:
spl_autoload_register('Modules::autoload');
This overrides __autoload() if you define it afterwards, took me a while to find that one Smile
Anyway, In Modules::autoload, only files from 'library/' are autoloaded. Isn't this supposed to be 'core/' in CI2? I changed it to
Code:
if (is_file($location = APPPATH . 'core/' . $class . EXT))
(line 164)
and now I have a base_controller in /application/core/ which will be loaded automatically if needed Smile I'm a happy man!

So can you give your opinion please on this change, maybe it's really stupid, I don't know, but for now it works like a charm.

Thanks for all your good work for the community!

[eluser]Phil Sturgeon[/eluser]
Yep, if you want base controllers in core you'll need to point it that way.

[eluser]Rolly1971[/eluser]
@phil Sturgeon:

Hi Phil,

first off, thanks to you and wireddesignz for a great library. All i had to do to get it working was copy past a few files and then move the default welcome controller and view files into a folder : 'welcome' under modules and it worked pretty much out of box. So cheers for that Smile

i am also looking at the widget lib, which i see by looking at PyroCMS you have implemented that as well. But you have the widget lib under a folder : 'widget' in the module folder, was there a reason for that? or will the widget lib work proper as intended and have the widget folder under the root of the application folder??

so will is work with like this:

application/
->widgets/
-->M_First_Widget/

or do i have to have it like this:

application/
->modules/
-->widgets/
--->my_first_widget/

thanks for the feedback.

[eluser]Phil Sturgeon[/eluser]
There are three aspects of Widgets. The widgets are defined in application/widgets, they are implemented through the widgets module (controllers, models, views, etc) then linked together with the library.

The Widgets code is not portable enough to be thrown into any application unless you really don't mind getting your hands dirty. I have ported this code to ExpressionEngine and another internal CMS I work on and both were TOUGH to get implemented. Go ahead and use it if you like, but I really can't offer you support with that.

[eluser]Haqqi[/eluser]
Hi everyone.

I'm new to CodeIgniter, but already have some plan to create my application using CodeIgniter. One of my favorite library is this Modular Separation.

Anyway, I will also use this template library http://williamsconcepts.com/ci/codeignit...index.html

But I faced a problem, that is I cannot put my template in module. I have read the Template source code, and the problem is this library only finds the template files within APPPATH/views folder. But what I want is this library to be able to cooperative with Modular Separation, that is flexibility access view file whether in modules path or APPPATH.

It means, I have to edit the Template library source code, and locate the line that will search the file, and replace it with Modular Separation function. But I'm really blind how to do it.

Anyone can help?

[eluser]Phil Sturgeon[/eluser]
My template library is compatible with modular views.

[eluser]Haqqi[/eluser]
Any further documentation how to use your template library?

And with this line, "Set a theme name and your layout will be loaded from application/themes/theme_name/views/layouts/layout_name.php"

Has it to be in that structure? How about in module folder using Modular Separation?




Theme © iAndrew 2016 - Forum software by © MyBB