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

[eluser]fredwu[/eluser]
That's great! Thanks wiredesignz. Smile
#32

[eluser]wiredesignz[/eluser]
Modular Separation - PHP5 version 1.07 is attached to this post.

Updated Modules::find() code in line with Modular Extensions - PHP5 version 5.2.27

EDIT:
deprecated file removed
#33

[eluser]Benedikt[/eluser]
Is there a documentation somewhere how to use it?
#34

[eluser]wiredesignz[/eluser]
Documentation:
Quote:Modular Separation allows you to use modules for code organization in your application.

Modules now comply with CI 1.7.2, Controllers in sub-directories are supported and resources may be cross loaded from other modules.

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.
#35

[eluser]Unknown[/eluser]
Does it autoload all config files in the modules config directory?
It seems like my application loads the config files twice.

And looking in the log, the config class and language class is also loaded twice?
And with global XSS filtering on, it filters twice too.

Else, really nice work - i love it!
#36

[eluser]Zandy[/eluser]
This is my steps:
- extract a fresh CI 1.7.2 to local server and change the base url to respect my installation dir
- hit a base url:
Code:
http://localhost/ci_test/

- extract a fresh (Modular Separation 17) and put MY_Loader.php and MY_Router.php in application/libraries

-create a modules folder
-create a "mymodule" folder into modules.

....

Quote:application
--->modules
---->mymodule
--->controllers
--->welcome.php

Code:
class Welcome extends Controller
{
  function __construct() { parent::Controller; }
  function index(){ echo 'testing'; }
}

i put the following url

Quote:http://localhost/ci_test/index.php/mymodule/welcome

and...

Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/MY_Router.php

Line Number: 61
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/MY_Router.php

Line Number: 66
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/Router.php

Line Number: 201
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/Router.php

Line Number: 207
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/Router.php

Line Number: 210
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\mod\system\libraries\Exceptions.php:166)

Filename: codeigniter/Common.php

Line Number: 360
404 Page Not Found

The page you requested was not found.

whats wrong. /???x!?
#37

[eluser]wiredesignz[/eluser]
@Zandy, You only need to post the first error. The other errors are caused by the first. Thanks.

Check that you have your default controller set properly and that you are using a uri_protocol setting that works for your server.

In any case I will release a patch to stop that error occuring, but it will not fix a faulty installation setup.
#38

[eluser]wiredesignz[/eluser]
@Joakim Kejser, Look again, you will see that the Config and Language objects are initialized twice, they are not loaded twice. This is by design as the original classes are extended and replaced, ready to be used in modules.

Yes, some config files are loaded from modules if they exist.
#39

[eluser]wiredesignz[/eluser]
Modular Separation - PHP5 version 1.08 is attached to this post.

Patched to prevent missing segment index error instead of page not found.

EDIT:
deprecated file removed
#40

[eluser]Zandy[/eluser]
@wiredesignz : my default controller in routes.php is "welcome".... ($route['default_controller'] = "welcome"Wink

one questions!... This directory structure is correct. ???

Quote:─system
├───application
│ ├───config
│ ├───controllers
│ │ (I remove welcome.php from here!!)
│ ├───errors
│ ├───helpers
│ ├───hooks
│ ├───language
│ │ └───english
│ ├───libraries
│ ├───models
│ ├───modules
│ │ └───mymodule
│ │ └───controllers
│ │ │ (here welcome.php)
│ │
│ └───views
├───cache
.
.
.
. etc...

<?php

Code:
class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
    }
    
    function index()
    {        
        echo 'Please, enter here !!!!';
    }
}


in module folder. only have one folder "controllers"

ahh... i download the latest version (18) .....and now.. show 404 error message..????

greetings..!




Theme © iAndrew 2016 - Forum software by © MyBB