я сделал так
$models = self::find()->where('created_at')->all();
$currentMonth = null;
foreach($models as $model){
$month = date('F', $model->created_at);
if($currentMonth <> $month){
echo $currentMonth = $month;
}
// вывод записи
}
и когда вардамплю то плучаю null, я че та туплю , не могу понять как сделать(((
$models = self::find()->where('created_at')->all();
$currentMonth = null;
foreach($models as $model){
$month = date('F', $model->created_at);
if($currentMonth <> $month){
echo $currentMonth = $month;
}
// вывод записи
}
и когда вардамплю то плучаю null, я че та туплю , не могу понять как сделать(((