CodeIgniter Forums
Modular Separation - PHP5 (Modules) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Modular Separation - PHP5 (Modules) (/showthread.php?tid=20208)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33


Modular Separation - PHP5 (Modules) - El Forum - 11-21-2010

[eluser]eokorie[/eluser]
Are there any plans to get Modular Separation working with the community branch of CI2.0? A few errors do pop up when I try Modular Separation and i think its due to the fact that PHP4 Support has been removed. Not looking to change over to the community branch version just yet but just testing a few things out.


Modular Separation - PHP5 (Modules) - El Forum - 11-21-2010

[eluser]wiredesignz[/eluser]
@By AzraiL, Modular Separation functions properly with PHP 5.3.0 on my server. I cannot help you unless you give a better error description than "blank page".

@eokorie, I fully expect the community branch to support modules.


Modular Separation - PHP5 (Modules) - El Forum - 11-21-2010

[eluser]By AzraiL[/eluser]
@wiredesignz sorry local server problem Smile dedicated server on working Smile


Modular Separation - PHP5 (Modules) - El Forum - 11-22-2010

[eluser]Mischievous[/eluser]
Modular Separation will work with latest release of CI2.0 with a few modification. Remember to use CI_ prefix for models/controllers/ etc. Also, There is a function inside of The Loader that gets model assets... there is no need for that as CI comes with some magic __get() functions... Smile... will hopefully get a page up soon, my current version is hacked to death for my current project.

PM me if you are having issues with this. Be glad to help you out.


Modular Separation - PHP5 (Modules) - El Forum - 11-23-2010

[eluser]wiredesignz[/eluser]
@Mischievous, If you look more carefully at the code in the MX_Loader class you will see that nothing is assigned to Models in CI 2.0

That code remains there only for CI 1.7


Modular Separation - PHP5 (Modules) - El Forum - 11-30-2010

[eluser]shanemesser[/eluser]
Can someone please explain (in layman's terms) the following? I know this is basic stuff, but the internet is flooded with information and I've spent the better part of 4 hours trying to answer some pretty basic stuff (because there doesn't seem to be a simple 1-2-3-4 guys on using MX outside of just a hello world example). I'm hitting the point of sheer frustration on this because I came to CI wanting to use it, then discovered that it doesn't have MMVC then discovered MX, then not being able to even get a simple authorization system like Tank_Auth to work after putting it into a module.

1. When does someone extend CI, MX, or MY? Is CI only extended when you are not using a Module MVC component?

2. Do you only extend the controllers or also the v's and m's?

3. Conceptually, are the MX/MY extensions of CI, so that you do do a CI->MX->method, or are they separate objects completely?

4. Can you give an example of when you would change a path and when you wouldn't (ie, use domain/cont/method vs. domain/mod/cont/method/)


Modular Separation - PHP5 (Modules) - El Forum - 12-02-2010

[eluser]ronan13[/eluser]
Hi, and thanks for HMVC.

Just a question about inheritance with MY_Controller.
I actually use MY_Controller to load/set some basic parameters. When i run a module controller from another (not module, both extended to MY_controller) with modules::run(), it seems the controller's module breaks models and other libraries loaded.

A concret example is:

The current controller (from main codeigniter controllers folder) is extended to MY_Controller
In MY_Controller constructor, i access to model: $this->the_model->get(...)

When i run modules::run('path_to_/moduleController/method'), i an "Undefined property: :moduleController:$the_model"

Should i move all extended controllers to modules to get a proper inheritance in this context?


Modular Separation - PHP5 (Modules) - El Forum - 12-02-2010

[eluser]wiredesignz[/eluser]
If you are using HMVC features by calling Modules::run() then your base controller (MY_Controller) must extend MX_Controller.

HMVC controllers do not need to be located in modules, the main application directory is also treated as a module.

If there is any other issue, please show some code.


Modular Separation - PHP5 (Modules) - El Forum - 12-03-2010

[eluser]ronan13[/eluser]
Ok, extending to MX_Controller solved the problem, thank.

Now i have to figure out why class properties (from controllers) are no longer transmitted to views.
As i know that not really a "good" Codeigniter practice, i'ill consider to send those properties with load->vars() to views.

I'll check your code soon to understand how it works...

Thanks again.


Modular Separation - PHP5 (Modules) - El Forum - 12-04-2010

[eluser]DeaD SouL[/eluser]
Hi,

Can I use an external folder for views ?

my structure is like this:
Code:
Private/
|__application/
|__system/
|__logs/
|__cache/
Public/
|__themes/
|  |__backend/
|  |  |__default/
|  |__frontend/
|     |__default/
|__uploads/
|__javascripts/
index.php
I used to modify the "$this->load->_ci_view_path"
but it doesn't work with modular separation..

So, how can I do it?

By the way, I'm using CI 2

Thanks