Im trying to use the built in dropdown HTML helper, but i cant find how to add the id="idvalue"
The documentation give this example,
echo Form::select('size', array('L' => 'Large', 'S' => 'Small'));
When i try the following code, i get errors
echo Form::select('size', array('L' => 'Large', 'S' => 'Small'), 'id' => 'idvalue');
Im using Laravel 4.
Any help would be greatly appreciated.
Cheers,
From the source code of FormBuilder.php:
/**
* Create a select box field.
*
* @param string $name
* @param array $list
* @param string $selected
* @param array $options
* @return string
*/
public function select($name, $list = array(), $selected = null, $options = array());
So you should call
echo Form::select('size', array('key' => 'value'), 'default', array('id' => 'ID_HERE'));
The easy answer
echo Form::select('size', array('L' => 'Large', 'S' => 'Small'), 'L', array('id' => 'idvalue'));
fourth parameter must be an array
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With