Welcome Guest, Not a member yet? Register   Sign In
loading a config file
#1

[eluser]bas_vdl[/eluser]
i want to load an item that is located in a config file. the file is form_validation.php and inside the file there is an array like this:

Code:
$config = array(
    'login' => array(
        array(
            'field' => 'username',
            'label' => 'gebruikersnaam',
            'rules' => 'required'
        ),
        array(
            'field' => 'password',
            'label' => 'wachtwoord',
            'rules' => 'required|md5'
        )
    )
)

?>


i try to do it like this but the print_r is EMPTY
Code:
<?php
    $this->config->load('form_validation', TRUE);
    $validation = $this->config->item('login', 'config');
    print_r($validation);
?>
#2

[eluser]Clooner[/eluser]
Try:
Code:
<?php
    $this->config->load('form_validation', TRUE);
    $validation = $this->config->item('login', 'form_validation');
    print_r($validation);
?>
If that doesn't work try if the config file is loaded correctly by including a
Code:
die(print_r($config));
at the end of it




Theme © iAndrew 2016 - Forum software by © MyBB