Browse Source

added support for select multiple.

Taylor Otwell 13 years ago
parent
commit
8ab33cf8c8
1 changed files with 8 additions and 1 deletions
  1. 8 1
      laravel/form.php

+ 8 - 1
laravel/form.php

@@ -381,7 +381,14 @@ class Form {
 	 */
 	protected static function option($value, $display, $selected)
 	{
-		$selected = ($value == $selected) ? 'selected' : null;
+		if (is_array($selected))
+		{
+			$selected = (in_array($value, $selected)) ? 'selected' : null;
+		}
+		else
+		{
+			$selected = ($value == $selected) ? 'selected' : null;
+		}
 
 		$attributes = array('value' => HTML::entities($value), 'selected' => $selected);