I have a table with columns (id, name) whereas in name, I have name of months (january, february...) I want to take all this name and return it in dropdownlist where I can take one of month. I have this function in my model:
public function getMonths()
{
$month= Months::find()
->asArray()
->all();
for($monthNum = self::MY_START; $monthNum <= self::MY_MONTH; $monthNum++){
return $month[$monthNum];
}
}
Now it only returns me one month (2 february ). What should I do to return in this dropdown list only name of these months?