Welcome Guest, Not a member yet? Register   Sign In
Help using modular extensions please
#11

[eluser]wiredesignz[/eluser]
controllers/mainnav.php
#12

[eluser]k2zs[/eluser]
yes, that is correct, I didn't post it correctly here
#13

[eluser]wiredesignz[/eluser]
Where is the code to load your model?
Are there other errors on the page? Check and resolve the very first error if there are others.
Is the page controller also extending MX_Controller?
#14

[eluser]k2zs[/eluser]
Yes I have tried extending the "home"controller with:

Code:
<?php
class Home extends MX_Controller
{
    function __construct()
    {
        // load controllers parent
        parent::Controller();
        // load this controllers model
        $this->load->model('home_model');
        $this->load->helper('text');

    }

That really breakes the code...

I am also calling my model for mainnav in the constructor
#15

[eluser]wiredesignz[/eluser]
Which part of "Use PHP5 constructors" do you not understand man? You are making me repeat my earlier posts here.

Code:
<?php

class Home extends MX_Controller
{
    function __construct()
    {
       //parent::Controller(); <- does not work with MX
       parent::__construct();
    }
#16

[eluser]k2zs[/eluser]
I guess the whole thing. I have only been working with CI for 2 weeks and am still trying to learn. When I extended the home controller as you say it doesn't even load anything because the error gets reported in the browsers location bar:

notice: Undefined variable: errorURL in /srv/www/htdocs/staging/ci.k2zs.com/application/errors/error_php.php on line 13
#17

[eluser]wiredesignz[/eluser]
Modular Extensions is pretty easy to use but you do need a good understanding of CodeIgniter OOP and PHP5 coding conventions.

I suggest you start with a clean CI 1.7 install again, add Modular Extensions and then move Welcome controller to a module. Then make Welcome extend MX_Controller. Make sure everything runs properly at each stage.

Don't forget to use PHP5 constructors for everything including Models

Go from there. Good Luck.
#18

[eluser]k2zs[/eluser]
[quote author="wiredesignz" date="1289718170"]Modular Extensions is pretty easy to use but you do need a good understanding of CodeIgniter OOP and PHP5 coding conventions.

I suggest you start with a clean CI 1.7 install again, add Modular Extensions and then move Welcome controller to a module. Then make Welcome extend MX_Controller. Make sure everything runs properly at each stage.

Don't forget to use PHP5 constructors for everything including Models

Go from there. Good Luck.[/quote]

Well I've spent a lot of time getting to know CI and I really am glad I found it.

Tonight I revisited Modular extensions and started with a clean install of CI 1.72 and the most current extensions download. I was able to get everything up and running without much trouble, just the usual learning curve stuff...

I have one question though... My main need for HMVC would be for modular page components and would rather not have them available through a url. How do I keep modular components hidden from the public?
#19

[eluser]wiredesignz[/eluser]
Use CI's _remap() method to trap URL based requests into your module controller. Either call show_404() in the _remap() method or redirect to another URL.
#20

[eluser]k2zs[/eluser]
very nice, thank you...




Theme © iAndrew 2016 - Forum software by © MyBB