I need to check wether a file is uploaded and if so require a title which isnt working. uploading is fine
// rules
[[‘portfolio3’], ‘validateCredential’],
public function validateCredential($attribute, $params)
{
if (is_object($this->imageFile) && $this->$attribute == '') {
$this->addError($attribute, "Enter Certificate #$no name's");
}
}
Problem is no error is showing even when the image is uploaded and the title isn’t filled up