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

[eluser]B___[/eluser]
Hello:

This may have been already covered or may be ridiculously obvious, so I apologize in advance for either case.

I am experimenting with the new Form Validation class (which I love so far). Is there an easy way to display the labels that are defined in the $config array when setting rules? I had thought of just passing the $config to the view, but then wouldn't know how to access the label value by specifying the field value.

ie: given the following:

$config = array(
array(
'field' => 'username',
'label' => 'Username',
'rules' => 'required'
),
array(
'field' => 'password',
'label' => 'Password',
'rules' => 'required'
));

how would one access the label Username by specifying the field username.

I didn't see this ability anywhere in the manual, but thought it wouldn't be too hard to write a helper function to do this.

Any suggestions? Thanks in advance!


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