i am new in laravel, i have a dropdown list and i want to populate it with years from 'UserController' i dont want to write a long list of year, i just want years to be added on every year change.
in my controller
public function setYear(){
$op="";
for($i=2010;$i<date('Y')+1;$i++)
{
$op.="<option value=".$i.">".$i."</option></br>";
}
return View::make('admin.setYear')->with('options',$op);
}
in my view
<select name="gender">
<option>Select</option>
{{$op}}
</select>
i get this Undefined variable: op (View
how can i do this?