Welcome Guest, Not a member yet? Register   Sign In
Displaying labels in HTML from $config
#2

[eluser]James Gifford[/eluser]
I too would like to be able to output the value for the label as set in the config. I propose something like a set_label helper function similar to the set_value function.

This is how I'd like it to work:

Controller:
Code:
$this->form_validation->set_rules(array(
   array('field' => 'username', 'label' => $this->lang->line('username'), 'rules' => 'required'),
   array('field' => 'password', 'label' => $this->lang->line('password'), 'rules' => 'required'),

View:
Code:
<?= form_open('login') ?>
<p>&lt;?= form_label(set_label('username'), 'username') ?&gt;
&lt;?= form_input('username', set_value('username'))</p>

<p>&lt;?= form_label(set_label('password'), 'password') ?&gt;
&lt;?= form_password('password') ?&gt;</p>
&lt;/form&gt;

Or something like that.


Messages In This Thread
Displaying labels in HTML from $config - by El Forum - 10-30-2008, 09:20 PM
Displaying labels in HTML from $config - by El Forum - 11-06-2008, 03:08 PM
Displaying labels in HTML from $config - by El Forum - 11-06-2008, 03:23 PM
Displaying labels in HTML from $config - by El Forum - 11-10-2008, 04:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB