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

[eluser]Skulls[/eluser]
helpers are made for flexibility functions...
the $header stuff i see there is static... you should throw that $header information in a config and then set to autoload the config file or load the config where you need it

the config file:
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    $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\''
    );
    
    $config['header']=$header;

?>

and then in the controller you have (after the config file is autoloaded or manualy loaded)

Code:
$header = $this->config->item('header');
$header['title'] = "Auto Jantes";
$header['keywords'] = array("Auto", "Jantes");
$header['description'] = "Development Website";

in conclusion, you already have the config functions to get and store the static information.. so it makes no sense to make a helper for something already built Big Grin


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