ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Modular Extensions - HMVC version 5.4

January 29, 2011 1:58am

Subscribe [99]
  • #16 / Mar 07, 2011 9:55am

    Hartimer

    20 posts

    I have a question. I’ve read the documentation and the philosophy behind HMVC looks exactly what i’m looking for.
    However I’m concerned about the performance impact that it might have on large scale applications…

    Does HMVC required much additional memory?
    Does it add significant processing time to codeigniter?

  • #17 / Mar 10, 2011 1:27pm

    libeco

    6 posts

    I already posted this question elsewhere (here), but I thought I’d repost it here in the topic about Modular Extensions - HMVC.

    I am having a problem with routing when using Modular Extensions - HMVC (latest version from 2011-03-06) with CodeIgniter 2.0 (not Reactor).

    When I use this in application/config/routes.php:

    $route['nieuws'] = 'news/news/index';

    It works as expected.

    When I remove that line and place it in application/modules/news/config/routes.php, the browser just sends me to the default controller.

    Can anybody assist in this problem? Thanks in advance!

  • #18 / Mar 10, 2011 3:55pm

    wiredesignz

    2882 posts

    The “news” module does not require it’s own name to be specified in modules/news/config/routes.php

    $route['nieuws'] = 'news/index';
  • #19 / Mar 11, 2011 5:28am

    libeco

    6 posts

    Unfortunately that does not make any difference. Could there be any other reason why the routing is not working properly for me?

    Thanks in advance!

  • #20 / Mar 24, 2011 6:15pm

    otherjohn

    43 posts

    Hi,

    This issue might be related to HMVC

    I have an ajax form in a module controller

    after realizing that form validation was not working I added $this->load->library(‘form_validation’, array(‘CI’ => $this));  to it
    and when I submitted my ajax form I got this error

    ErrorException [ Fatal Error ]: Cannot use object of type Admin as array
    SYSDIR/var/www/vhosts/churchbackend.com/_sys/libraries/Form_validation.php [ 90 ]

    my controller is

    class Admin extends Admin_Controller {
    
    public $data=array();
    
        public function __construct()
           {
                parent::__construct();
                // Your own constructor code
           }
    
           function roles($user_id=NULL)
        {
            
                   $this->load->library('form_validation', array('CI' => $this)); 
                    if ($this->form_validation->run() == FALSE)
            {
                           ....show form
                    }else{
                        echo "submitted";
                   }
      }

    my Admin_controller is

    class Admin_Controller extends MX_Controller {
    function __construct()
           {
                parent::__construct();
                
                ... load stuff        
        
           }
  • #21 / Mar 26, 2011 12:05am

    DBPolito

    7 posts

    Hello,

    I’ve found a bug with languague autoloader. Sorry but i don’t have the details here, but will be nice if you take a look on it. I just remember that have a wrong param on calling the CI::lang->language(), i’ve fixed the param but still not working.

    Congratulations, you are doing a great work.

    Regards

  • #22 / Mar 26, 2011 3:55am

    wiredesignz

    2882 posts

    Hello,

    I’ve found a bug with languague autoloader. Sorry but i don’t have the details here, but will be nice if you take a look on it. I just remember that have a wrong param on calling the CI::lang->language(), i’ve fixed the param but still not working.

    ...

    There is no language method in the CI_Lang class.

  • #23 / Mar 28, 2011 12:30am

    RGM_

    5 posts

    Sorry if this is a case of me needing to read more.. but:

    Trying to autoload[‘language’] = array(‘sa’);

    ends up with the error message: Unable to load the requested language file: language/english/Array_lang.php

    Autoloaded helpers and libraries are fine though.

    Changing the controller from MY_ to CI_ makes it work..


    edit: Made a “MY_controller extends MX controller” with $this->lang-load() in its __construct() and seems to work fine.

    In the controller I’m using “home extends MY_controller” I can get a lang->line() out of it.

  • #24 / Mar 28, 2011 2:59am

    wiredesignz

    2882 posts

    @RGM_, Autoload language is working fine here.

  • #25 / Mar 28, 2011 10:57am

    DBPolito

    7 posts

    I think this problem happening only at Reactor Version.

  • #26 / Mar 28, 2011 4:41pm

    RGM_

    5 posts

    Updated to 2.0.1 from codeigniter.com it still comes up with array.

    Using wrong version?

  • #27 / Mar 30, 2011 1:09pm

    libeco

    6 posts

    ...
    Trying to autoload[‘language’] = array(‘sa’);

    ends up with the error message: Unable to load the requested language file: language/english/Array_lang.php

    Autoloaded helpers and libraries are fine though.

    ...

    edit: Made a “MY_controller extends MX controller” with $this->lang-load() in its __construct() and seems to work fine…

    I’m having this problem too, or at least a similar one. I’m using CI 2 (not Reactor). When trying to use the regular autoload for loading a language, I am presented with the same error as above. The autoload files in the modules directories are working fine for me.

    When I remove the language load from the original autoload en place a $this->lang->load() in the constructor of my MY_Controller, everything work fine.

  • #28 / Apr 03, 2011 5:20am

    theprodigy

    653 posts

    First off, thanks for MX. Your hard work is appreciated.

    I have a quick question. Can Modules contain more than 1 controller each? I tried to add a second controller to a module and it doesn’t seem to be working.

    I first created a ‘movies’ module, and inside it’s controllers directory, I put in a ‘movies’ controller. I went to

    <a href="http://my.domain.tld/movies">http://my.domain.tld/movies</a>

    and everything worked fine. But then I added a ‘actors’ controller, and tried to go to

    <a href="http://my.domain.tld/movies/actors">http://my.domain.tld/movies/actors</a>

    it didn’t work. I then tried to go to

    <a href="http://my.domain.tld/movies/actors/index">http://my.domain.tld/movies/actors/index</a>

    and it didn’t work either. When I added a ‘actors’ method to the ‘movies’ controller, that worked without a problem.

    My setup is:

    app
    —/controllers
    —/core
    —/—/MY_Controller.php (extends MX_Controller)
    —/[other stuff]
    —/models
    —/modules
    —/—/movies
    —/—/—/controllers
    —/—/—/—/movies.php (extends MY_Controller)
    —/—/—/—/actors.php (extends MY_Controller)
    —/—/—/models
    —/—/—/views
    —/views

    Am I doing something wrong?

    EDIT: I forgot to mention that I am using MX 5.4, alongside DMZ 1.8 (in case that helps any)

  • #29 / Apr 03, 2011 6:04am

    theprodigy

    653 posts

    disregard previous post. I’m an idiot 😛

  • #30 / Apr 05, 2011 10:09pm

    darkhouse

    323 posts

    Hey wiredesignz. First, this is great work, I’ve been using your system for a long time, maybe a couple years, I’ve got it integrated into my CMS and it works b.e.a.utifully… however…

    I just ran into an issue. My CMS is sort of a fallback system so that basically if the router doesn’t find a controller for the current URI, then it checks the CMS, and if it finds a page, it loads it, otherwise it returns a 404. The issue is, I have a page in the CMS with the slug ‘blog’, and then a module named ‘blog’. The blog page uses the blog module, naturally, but since the CMS is checked AFTER the router does it’s thing, it’s trying to load the content from the blog module. My question is, is there a way to disable the code that loads a module based on the URI, without breaking anything? Essentially for this project, I never want it to load a module right from the URI, I want it to either use an existing controller, or use the CMS.

    Thanks!

    Edit: I know the easiest thing to do would be either rename the page slug (which I’ve done in the mean time) or rename the module, but the issue is it’s possible with my system that someone could name something the same as a module, and then break their site. I just want to try and make it so that isn’t possible.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases