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 - Version 4.3

March 03, 2008 6:10pm

Subscribe [48]
  • #496 / Jul 09, 2008 11:33pm

    codex

    332 posts

    @codex, Is the module named public_controller too, otherwise use the prefix segment public/public_controller

    Yes, everything is called public_controller. And I’ve tried to prefix it too. No cigar.

    Maybe I just should look at it tomorrow with fresh eyes. I might be missing something crucial. It’s kinda late here.

  • #497 / Jul 10, 2008 3:28am

    wiredesignz

    2882 posts

    The ME guide to happiness

    1) Start with a clean CI install.
    2) Set $config[‘base_url’] correctly for your installation.
    3) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = happiness!
    4) Drop Modular Extensions libraries into application/libraries and application/helpers directories as specified.
    5) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = more happiness!
    6) Create module directory structure application/modules/welcome/controllers.
    7) Move controller application/welcome.php to application/modules/welcome/controllers/welcome.php.
    8) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = even more happiness!
    9) Create directory application/modules/welcome/views.
    10) Move view application/views/welcome_message.php to application/modules/welcome/views/welcome_message.php
    11) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = ecstasy!

    You now have a running Modular Extensions installation.

  • #498 / Jul 10, 2008 6:06am

    Sam Dark

    242 posts

    codex
    Are you trying to use base controller?

    I did by inluding it in Controller.php by using include(‘base_controllers.php’).

    I know this is not the right way but I didn’t found how to it better.

    wiredesignz
    Good one. Add this guide to the wiki 😊

    btw., still can’t solve my config issue from the past without editing ME code :(

  • #499 / Jul 10, 2008 8:15am

    codex

    332 posts

    codex
    Are you trying to use base controller?

    I did by inluding it in Controller.php by using include(‘base_controllers.php’).

    I know this is not the right way but I didn’t found how to it better.

    wiredesignz
    Good one. Add this guide to the wiki 😊

    btw., still can’t solve my config issue from the past without editing ME code :(

    Hey Sam, thanks for the advice. I was just thinking about doing it that way and I’m glad you confirmed that it will work that way.

    Cheers!

  • #500 / Jul 10, 2008 8:31am

    wiredesignz

    2882 posts

    btw, still can’t solve my config issue from the past without editing ME code :(

    @Sam, Please explain the problem loading config files.

    I have tested this inside a module controller and it works fine!

    //loads application/config.php to config sub-array
    $this->load->config('config', TRUE);
  • #501 / Jul 10, 2008 8:34am

    Sam Dark

    242 posts

    I’ll send you a test case later. Very busy now :(

  • #502 / Jul 10, 2008 8:41am

    codex

    332 posts

    The ME guide to happiness

    1) Start with a clean CI install.
    2) Set $config[‘base_url’] correctly for your installation.
    3) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = happiness!
    4) Drop Modular Extensions libraries into application/libraries and application/helpers directories as specified.
    5) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = more happiness!
    6) Create module directory structure application/modules/welcome/controllers.
    7) Move controller application/welcome.php to application/modules/welcome/controllers/welcome.php.
    8) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = even more happiness!
    9) Create directory application/modules/welcome/views.
    10) Move view application/views/welcome_message.php to application/modules/welcome/views/welcome_message.php
    11) Access the URL domain/subdir/index.php/welcome - Welcome to CodeIgniter = ecstasy!

    You now have a running Modular Extensions installation.

    Excellent :exclaim:

  • #503 / Jul 10, 2008 8:58am

    wiredesignz

    2882 posts

    Glad you like it. Wiki is updated also.

  • #504 / Jul 10, 2008 6:48pm

    codex

    332 posts

    @Wiredesignz: loading of views is not working as I would expect.

    I have this view file: modules/cms/views/dashboard/dashboard_view.php. From within the controller you’d think that this would do the trick:

    $this->load->view('dashboard_view', $data);

    But it gives me this error:

    An Error Was Encountered
    Unable to locate the requested file: application/views/cms_dashboard/dashboard_view.php

    The file is not being sought in the module views folder, but in application/views

    Ok, so I make the path:

    modules/cms/views/dashboard/dashboard_view.php

    But still it’s trying to locate the file in application/views/cms_dashboard/

    This can’t be good. Is there something wrong with my syntax?

    PS: I’m on PHP5. Should I use the other version of ME then?

  • #505 / Jul 10, 2008 6:59pm

    wiredesignz

    2882 posts

    Here are all the locations that ME will scan for dashboard_view.php if loaded from a controller in a module named cms.

    application/modules/cms/views/dashboard_view.php
    
    application/views/dashboard_view.php
    
    application/views/cms/dashboard_view.php
    
    application/modules/cms/views/controller_name/dashboard_view.php
    
    application/views/controller_name/dashboard_view.php

    Uncomment Modules.php - line 156 to see for yourself.

  • #506 / Jul 10, 2008 7:02pm

    codex

    332 posts

    Here are all the locations that ME will scan for dashboard_view.php if loaded from a controller in a module named cms.

    application/modules/cms/views/dashboard_view.php
    
    application/views/dashboard_view.php
    
    application/views/cms/dashboard_view.php
    
    application/modules/cms/views/cms/dashboard_view.php
    
    application/views/cms/dashboard_view.php

    Uncomment Modules.php - line 156 to see for yourself.

    Could you be referring to modules_helper.php? There’s no Modules.php in my app. And also nothing to uncomment anywhere on line 156. I have version 4.2.01.

    EDIT: Found it. It’s on line 168 in modules_helper.php

  • #507 / Jul 10, 2008 7:10pm

    wiredesignz

    2882 posts

    Grab Version 4.2.02 from the Wiki, Uncomment modules_helper.php - line 168

    echo '',$path2,$file_ext,''; /* debug paths */
  • #508 / Jul 10, 2008 7:11pm

    codex

    332 posts

    Grab Version 4.2.02 from the Wiki, Uncomment modules_helper.php - line 168

    Yeah, see previous comment 😊

    Getting v 4.2.02 now.

    Edit: There’s no 4.2.02 in the wiki, so I guess we’re talking bout 4.2.01

  • #509 / Jul 10, 2008 7:17pm

    codex

    332 posts

    Nope, it’s looking in all places BUT the right one:

    application/modules/cms/views/dashboard_view.php
    
    application/views/dashboard_view.php
    
    application/views/cms/dashboard_view.php
    
    application/modules/cms/views/cms_dashboard/dashboard_view.php

    Should look in application/modules/cms/views/dashboard/dashboard_view.php

    Obviously when I change /dashboard/ to /cms_dashboard/ the file is found (at least, the error is gone), but this would mean you HAVE to name the folder exactly the same as the controller. Is this the case?

  • #510 / Jul 10, 2008 7:28pm

    wiredesignz

    2882 posts

    Why do you say IT should be looking, Really your view file should be placed in the scan path.

    I assume cms_dashboard is your controller name? located in your cms module? So where does dashboard come in? and how do you expect ME to find the file when there is no reference to dashboard anywhere?

    Try prefix segments like: $this->load->view(‘cms/dashboard/dashboard_view’);  EDIT: (probably won’t work)

    You do like to make life difficult for yourself. 😉

    EDIT:
    Yes it makes sense to keep module sub-directory names the same as the controller name. You could always rename the controller to dashboard.php

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

ExpressionEngine News!

#eecms, #events, #releases