Unable to implement HMVC? |
[eluser]gRoberts[/eluser]
Hi all, For some reason, I am experiencing issues whilst attempting to install and use Wiredesignz' HMVC plugin/library and I've tried absolutely everything with fail.... So, from the start, I copy across the MX folder into my `third_party` folder and then copy the MY_ prefixed files into my `core` folder. At this point, I get the following error: Code: Fatal error: Access to undeclared static property: CI::$APP in /mnt/var/vcap.local/dea/apps/gfwv-0-9ec21c435d3b27396a7090c17847e9eb/app/application/third_party/MX/Loader.php on line 47 I then change my controller to extend the `MX_Controller` instead of the `CI_Controller` and I then get the following error: Code: Fatal error: Cannot redeclare class CI in /mnt/var/vcap.local/dea/apps/gfwv-0-ab605504fa4f243ea48462b4d108e0a4/app/application/third_party/MX/Base.php on line 57 At this point, I have the vanilla setup, however my controller is within the application/controllers folder. Moving my controller to `modules/Front/Front.php` makes no difference what so ever to the above. I only have one controller so far, `Front` being the main controller for the site. Code: application I have absolutely no idea what could be the cause. After searching about, most people are effected because the other controllers are not extending MX_Controller, however I only have one controller, which is: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Any idea's? Many thanks Gavin
[eluser]XMadMax[/eluser]
Hey gRoberts, I dont't see the main problem, but.... You must to rename MY_loader.php to MY_Loader.php, and MY_router.php to MY_Router.php Any Modules directories must to be created lowercase (modules/front/front.php) Clases must to be declared capitalized: Code: class Front extends ..... I also recommend to create MY_Controller: Code: <?php (defined('BASEPATH')) OR exit('No direct script access allowed'); And any controller extending from MY_Controller Code: class Front extends MY_Controller I hope this can help. Also, you can try XHMVC: https://bitbucket.org/xperez/codeigniter...ions-xhmvc , a ready-to-go HMVC with common folders to share yuor development bertweem multiple apps. |
Welcome Guest, Not a member yet? Register Sign In |