Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - Version 4.3

[eluser]Sam Dark[/eluser]
I'll send you a test case later. Very busy now Sad

[eluser]codex[/eluser]
[quote author="wiredesignz" date="1215689287"]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.[/quote]

Excellent :exclaim:

[eluser]wiredesignz[/eluser]
Glad you like it. Wiki is updated also.

[eluser]codex[/eluser]
@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:

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

But it gives me this error:
Code:
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:
Code:
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?

[eluser]wiredesignz[/eluser]
Here are all the locations that ME will scan for dashboard_view.php if loaded from a controller in a module named cms.
Code:
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.

[eluser]codex[/eluser]
[quote author="wiredesignz" date="1215745177"]Here are all the locations that ME will scan for dashboard_view.php if loaded from a controller in a module named cms.
Code:
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.[/quote]

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

[eluser]wiredesignz[/eluser]
Grab Version 4.2.02 from the Wiki, Uncomment modules_helper.php - line 168
Code:
echo '<p>',$path2,$file_ext,'</p>'; /* debug paths */

[eluser]codex[/eluser]
[quote author="wiredesignz" date="1215745809"]Grab Version 4.2.02 from the Wiki, Uncomment modules_helper.php - line 168[/quote]

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

[eluser]codex[/eluser]
Nope, it's looking in all places BUT the right one:

Code:
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?

[eluser]wiredesignz[/eluser]
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. Wink

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




Theme © iAndrew 2016 - Forum software by © MyBB