Welcome Guest, Not a member yet? Register   Sign In
Global Includes?
#1

[eluser]SplashCreativity[/eluser]
Hey everyone, I'm not new to MVC frameworks though I am relatively new to codeignitor.
What can I say, I love it!

I have an issue though, I have my welcome controller for the first page, which goes something like this:

Code:
function index()
    {
        $header['title'] = "Auto Jantes";
        $header['keywords'] = array("Auto", "Jantes");
        $header['description'] = "Development Website";
        $header['content_title'] = "Bienvenue chez AutoJantes";
        
        $this->load->helper('form');
        
        $header['email'] = array(
            'name'      =>    'email',
            'value'     =>    'Adresse email',
            'class'     =>    'menu_input',
            'onClick'    =>    'this.value=\'\''
        );
        
        $header['password'] = array(
            'name'      =>    'password',
            'value'     =>    'Mot de passe',
            'class'        =>    'menu_input',
            'onclick'    =>    'this.value=\'\''
        );
        
        $header['submit'] = array(
            'name'        =>    'submit',
            'value'        =>    'Connexion',
            'class'        =>    'menu_submit'
        );
        
        $header['register'] = array(
            'name'        =>    'register',
            'content'    =>    'Joindre',
            'class'        =>    'menu_submit',
            'onClick'    =>    'location.href=\'register\''
        );

        $this->load->view('template/header', $header);
        $this->load->view('welcome');
        $this->load->view('template/footer');
    }

As you can see I am using the form helper in my header, this is because the header page has a box which asks users to login (shown on each page) unless they are logged in it will show a menu.

My issue is, I don't want to have to place the 17 lines for that login form on every controller / controller function I make. That would suck, instead I'm wondering is there no easy way of including the form helper stuff on every controller by default?


Best Regards
Stephen


Messages In This Thread
Global Includes? - by El Forum - 06-03-2008, 02:14 PM
Global Includes? - by El Forum - 06-03-2008, 03:04 PM
Global Includes? - by El Forum - 06-03-2008, 03:17 PM
Global Includes? - by El Forum - 06-03-2008, 03:19 PM
Global Includes? - by El Forum - 06-04-2008, 02:44 AM
Global Includes? - by El Forum - 06-04-2008, 03:02 AM
Global Includes? - by El Forum - 06-04-2008, 03:11 AM
Global Includes? - by El Forum - 06-04-2008, 06:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB