[BUG]: caught TypeError: Argument 1 passed to Phalcon\Flash\AbstractFlash::error() must be of the type string, object given #118
Unanswered
imakepossible
asked this question in
Q&A
Replies: 1 comment
-
Hello,
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
I have a form and when i validate it to check email address and when i enter wrong email it gives error message but it is not flashing and giving error
"Fatal error: Uncaught TypeError: Argument 1 passed to Phalcon\Flash\AbstractFlash::error() must be of the type string, object given in C:\wamp64\www\phaldemo\app\controllers\UsersController.php on line 152"
My code to get errors on submitting form:
foreach ($user->getMessages() as $message) {
$message - when i use print_r($message), i am getting this output
Phalcon\Messages\Message Object
(
[code:protected] => 0
[field:protected] => email
[message:protected] => Please enter a correct email address
[type:protected] => Phalcon\Validation\Validator\Email
[metaData:protected] => Array
(
)
)
But this $this->flash->error($message); giving error "Uncaught TypeError: Argument 1 passed to Phalcon\Flash\AbstractFlash::error() must be of the type string, object given"
How i will able to access protected message value "Please enter a correct email address"
Beta Was this translation helpful? Give feedback.
All reactions