Created
November 12, 2010 15:09
-
-
Save igniteflow/674190 to your computer and use it in GitHub Desktop.
Set a default value on a select form element in CakePHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo $form->input('field_name', array( | |
'type' => 'select', | |
'options' => $arrayOfOptions, // typically set from $this->find('list') in controller | |
'label'=> 'Label name here', | |
'value' => $arrProjectLeaderDetails['id'], // specify default value | |
'escape' => false, // prevent HTML being automatically escaped | |
'error' => false, | |
'class' => 'input_select_medium' | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment