$time = new \DateTime('now');
$today = $time->format('Y-m-d');
$programs=Programs::find()->where(['close_date' >= $today])->all();
This is code for today's programs whose close_date
is greater than today's date
. I am getting error:
"Invalid Parameter -yii\base\InvalidParamException Operator '1' requires two operands".
If you want to write
where
condition as array the code should be like this:Check official documentation for more details:
Or like this code: