I am developing a new login module in Yii framework:
class LoginForm extends Model
{
public $username;
public $password;
private $_user = false;
public function rules()
{
return [
// username and password are both required
[['username', 'password'], 'required'],
];
}
}
Form validation is working for above code and error message is visible in input box below. But I need to display global error message in top of the page.
I need callback function after form validation. Please help me to fix this problem.