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

[eluser]Phil Sturgeon[/eluser]
[quote author="Buso" date="1278225100"][quote author="loosetops" date="1278224169"][quote author="Buso" date="1277620721"]Has that feature been removed in MS? Why?[/quote]

It has not been removed. It was never a feature in MS it is a feature of ME. I understand by the design of MS it isn't possible to implement or doing so would make MS dirty and slow.

Also you should be able to design you code so as not to require such a feature, check Phil Sturgeons Template system.[/quote]
I have my own theming/templating system, thanks

But I still need the mentioned feature.. And its not something crazy I just came up with, it feels very natural and AFAIK, there are other frameworks/CMSs that have it actually, like ExiteCMS (and as you said, ME has it too).. I'm just trying not to go so far away from CI. If I don't find the solution here I'll write it myself, but it would be nice not to waste time if there are ppl who have already done that.[/quote]

Have a look at PyroCMS. We have a comments module, using Modular Separation v2.1 and we use partial views to include the comments form and comments lists onto any page.

[eluser]Buso[/eluser]
[quote author="Jelmer" date="1278342125"]No, no DB routing. But everything that isn't handled by a controller is assumed to be just a normal page on the website and send to the Pages controller.
The code I posted checks whether the current first segment matches a module and adds the exception to the :any rule when a module was found. So such a request is indeed handled by the module-controller.[/quote]
I see, thanks Smile

[quote author="Phil Sturgeon" date="1278343562"][quote author="Buso" date="1278225100"][quote author="loosetops" date="1278224169"][quote author="Buso" date="1277620721"]Has that feature been removed in MS? Why?[/quote]

It has not been removed. It was never a feature in MS it is a feature of ME. I understand by the design of MS it isn't possible to implement or doing so would make MS dirty and slow.

Also you should be able to design you code so as not to require such a feature, check Phil Sturgeons Template system.[/quote]
I have my own theming/templating system, thanks

But I still need the mentioned feature.. And its not something crazy I just came up with, it feels very natural and AFAIK, there are other frameworks/CMSs that have it actually, like ExiteCMS (and as you said, ME has it too).. I'm just trying not to go so far away from CI. If I don't find the solution here I'll write it myself, but it would be nice not to waste time if there are ppl who have already done that.[/quote]

Have a look at PyroCMS. We have a comments module, using Modular Separation v2.1 and we use partial views to include the comments form and comments lists onto any page.[/quote]
I'll check that out, thanks

[eluser]Pieter[/eluser]
Question: Can I use a MY_Controller class inside a module like:
application/modules/mymodule/libraries/MY_Controller.php

If not, is there another way to extend the core controller for just that module?

Thanks!

[eluser]Phil Sturgeon[/eluser]
No but you can make a MY_Controller and use $this->router->fetch_module() to do different stuff.

[eluser]Pieter[/eluser]
Ok thanks. So you can't drop in any application into a module like suggested below:

[quote author="wiredesignz" date="1256182612"]Documentation:
Quote:You should be able to take any CodeIgniter application and place it into a module and it should work without alteration. However routes might need altering to allow for the added separation of a module.
[/quote]

There wouldn't be an easy hack that would make this possible, or is this an undesired method?

[eluser]Phil Sturgeon[/eluser]
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.

[eluser]Pieter[/eluser]
Ok, thanks for clarifying.
I am looking for a good frontend/backend setup and just wanted to learn some more.

Edit: Just red your article on Base Classes (http://philsturgeon.co.uk/news/2010/02/C...ing-it-DRY), thats just what I wanted to know. Thanks!

[eluser]Buso[/eluser]
I have been reading PyroCMS code for widgets and found this o.o :
Code:
// wirdesignz you genius
    function __get($var)
    {
        static $ci;
        isset($ci) OR $ci =& get_instance();
        return $ci->$var;
    }

to-do list: learn all the php magic stuff u___u

[eluser]dejavu[/eluser]
[quote author="Phil Sturgeon" date="1278554616"]No but you can make a MY_Controller and use $this->router->fetch_module() to do different stuff.[/quote]

I'm currently using ME, and want to switch to MS. But I'm looking for a way to call a controller from within a controller. This works in ME - load a website controller,
Code:
$website_controller = modules::load('websites');

then pass it to a view:
Code:
$website_controller->partial($client->id);

I realize passing a controller to a view isn't kosher, but this way I avoid the need for output buffering.

Is there a similar functionality in Modular Separation? Would $this->router->fetch_module() let me do the same thing? Thanks!

[eluser]Phil Sturgeon[/eluser]
Nope, modular separation doesn't do that.




Theme © iAndrew 2016 - Forum software by © MyBB