I’m having a hard time debugging to locate the issue here.
I’ve tried echoing $login_by_username and $login_by_email but they aren’t echoing.
The problem is when it loads the login form it always puts email as the label.
Controller:
$login_by_username = $this->config->item('login_by_username', 'config1');
$login_by_email = $this->config->item('login_by_email', 'config1');
$this->data['login_by_username'] = $login_by_username;
$this->data['login_by_email'] = $login_by_email;
View:
<?php
if ($login_by_username AND $login_by_email)
{
$login_label = 'Email or Username';
}
else if ($login_by_username)
{
$login_label = 'Username';
}
else
{
$login_label = 'Email';
}
?>
<?php echo form_label($login_label, 'login'); ?>
Config:
$config['login_by_username'] = TRUE;
$config['login_by_email'] = TRUE;
According to our comments.
You have used the
autoload.phpto call your config file.You made some tests to make sure that the problem is with your
config1.phpfile and not withCI.I’ve made a test and here is what I did.
I have created a file
config1.phpinside:application/config.Here it is:
On my
autoload.phpalso insideapplication/config:$autoload['config'] = array('config1');My Home Controller:
My view:
And
config1 testis echoed as expected.