• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.