Hi i have problem with ajax validate.
My own validate
public function validateData($attribute, $params)
{
foreach ($this->addsLengthMovieIntoSeanseData()['dataWstepna'] as $key => $item) {
if ($this->$attribute >= $this->addsLengthMovieIntoSeanseData()['dataWstepna'][$key] &&
$this->$attribute <= $this->addsLengthMovieIntoSeanseData()['poseansie'][$key]
)
{
$this->addError($attribute, 'data seansu jest już zajęta');
}
}
}
This working only if I have in database at least one item… if database is emptyI gets international error 500 (see screen) Why?
Image: