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.3

August 30, 2010 3:03am

Subscribe [81]
  • #16 / Sep 08, 2010 8:50am

    Phil Sturgeon

    2889 posts

    I’m happy to admit I dont have a full understanding on this one, as the code in ME is extremely bloody advanced. Basically I need to get my MY_Controller into the inheritance of everything, but if I make MY_Controller extend MX_Controller, then Admin_Controller extend MY_Controller then global properties are not available in code outside or MY_Controller.

    Besides that I’m having a few errors without any of my modifications. Running a clean install (with nothing other than my extra MY_Controller class in the MY_Controller.php) I am getting this error http://drp.ly/1GCq1E

    If you can hop on IRC then I’d like to go through these. Either I’m doing something wrong (more than likely!) or I have actually spotted a bug. It could go either way.

  • #17 / Sep 08, 2010 5:54pm

    wiredesignz

    2882 posts

    MY_Controller is never actually required as a class by CI, if the MY_Controller.php file is found it will be loaded automatically but it can contain any class declaration(s) you like.

    The language issue might be solved if you create MY_Lang.php which requires MX/Lang.php and add the MY_Lang extends MX_Lang class declaration.

  • #18 / Sep 09, 2010 8:43am

    Phil Sturgeon

    2889 posts

    As per our interesting conversation yesterday, you need to add the MY_Lang.php to the codebase to enable autoloading of languages. That will solve the error and that is not just something happening for me.

  • #19 / Sep 09, 2010 12:24pm

    Peccavio

    55 posts

    Thanks wiredesignz & Phil Sturgeon 😊

    It’s been quite awhile since I’ve played with CodeIgniter.

    CI 2.0 with HMVC has me excited,

    The two of you made it easy to get started.

    I feel like a newbie again

  • #20 / Sep 09, 2010 1:03pm

    XMadMax

    66 posts

    Hi Phil and Wire:

    I’ve installed the HMVC 5.3, removed MY_Controller from /application/libraries, and all works OK.
    I need to access from one model to another, and from one controller to another model other than same name model, I don’t know if would be better with or without MY_Controller ?

    My web structure:

    application:
      views
          default
              3columns.php
              2columns.php
              1column.php
          parts
                header.php
                footer.php
                leftbar.php
                rightbar.php
      modules
          categories
              controllers (must to have access some product model functions)
              models
              views (here I put only contents, ussing 1/2/3colums as main templates)

          products
              controllers (must to have access some category model functions)
              models
              views (here I put only contents, ussing 1/2/3colums as main templates)


    Thanks for your hard work, I think it’s a great experience to work with it.


    Xavier

  • #21 / Sep 09, 2010 6:35pm

    wiredesignz

    2882 posts

    @Phil. Yes if you are using module languages then core/MY_Lang.php will be required but I don’t see it being needed by everyone. I will leave it as optional at this stage.

    @Peccavio and @XPerez, Thank you both for your appreciation.

  • #22 / Sep 09, 2010 8:23pm

    Thank You for this wiredesignz, I got form_validation figured out and everything is working like a charm. Thanks Again!

  • #23 / Sep 10, 2010 8:12pm

    wiredesignz

    2882 posts

    @simpilot, No worries.

    Modular Extensions version 5.3.4 is available on bitbucket

    http://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc

  • #24 / Sep 10, 2010 9:32pm

    Developer13

    574 posts

    wiredesignz - thanks for continually providing and improving your awesome code.  I keep seeing threads and other bullshit with people claiming they’re going to write modular separation / hmvc the “right way”.  If a buffoon like me can figure out how to use ME, then I’m not sure from which direction these others think they are coming from.  It’s a transparent system… drop it in and start coding… there’s not a whole lot left for personal preference as to how it works.  Maybe these same people could improve some of PHP’s native functions, too… oh, wait, doesn’t CI have some wrappers for native PHP functions?  Shit, what’s going on in this world?

    Aww fuck it.

    Your stuff works, it works great, and I thank you for it!

  • #25 / Sep 11, 2010 2:04am

    Peccavio

    55 posts

    I feel like a newbie again

    There must be something simple I’m missing…

    When from login.php (Triad under application/modules)

    $this->load->model('members_model');
    $query = $this->members_model->validate();

    Get…  Undefined property: Login::$members_model

    When doing…

    $this->load->library('form_validation');

    Get:

    Severity: Notice
    
    Message: Undefined property: CI::$form_validation
    
    Filename: MX/Loader.php
    
    Line Number: 141

    Using version 5.3.4 and testing on CI 1.7.2

    I’d welcome any clue anyone might lend 😊

  • #26 / Sep 11, 2010 3:53am

    wiredesignz

    2882 posts

    Just updated Modular Extensions - HMVC on bitbucket, thanks to Developer13 for discovering my typo and logic bug in the Modules::find method.

  • #27 / Sep 11, 2010 7:38am

    Peccavio

    55 posts

    Found that controllers really do need to extend MX_Controller.

    class Login extends MX_Controller {
    
        function __construct()
        {
            parent::__construct();
        }

    This solved my problems

  • #28 / Sep 11, 2010 12:24pm

    asylmottaket

    28 posts

    Thanks for the great work!

    I have the code up and running.. except one issue.

    I seem to have the same questions as Phil (I think), that I can’t find answers on.. conserning use of Public_Controller, Admin_Controller and Whatever_Controller that the modules controllers could extend.

    If modules controllers should extend MX_Controller, how can I make inheritance and code logic similar to how it was done “before”?

    Like: Controller > MY_Controller > Public_Controller > Blog controller

    I’m lost..

  • #29 / Sep 11, 2010 6:39pm

    Ener1

    27 posts

    Wire, Phill first of all THANKS!!!!! this is great, I hope to have a full tutorial, lets say a minimun web development, no for me but to teach the junior team in my work

    If you know about something like this please tell me

    One more question, Phill is there a way to integrate tinycimm in the modular way?!!

    Thanks again

  • #30 / Sep 11, 2010 7:35pm

    wiredesignz

    2882 posts

    @asylmottaket, Any controller can descend from MX_Controller, wether or not you actually use the MY_Controller class, you can have other base class declarations in the MY_Controller.php file, or, simply use the MY_Controller.php file to include your other base classes as well as the MX / Controller.php file.

    @Ener1, try the wiki.

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

ExpressionEngine News!

#eecms, #events, #releases