New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a form message in controller doesnt show in view #12037

Closed
Izopi4a opened this Issue Jul 27, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@Izopi4a
Contributor

Izopi4a commented Jul 27, 2016

if i do this in the controller

$messages = $form->getMessages('name');
$messages->appendMessage(new  \Phalcon\Validation\Message("yohooo") );
var_dump($messages); // shows 1 message

however in the view

$form = $this->view->getVar("form");

var_dump($form->getMessages()); //prints null in view

discussed here https://forum.phalconphp.com/discussion/12205/appending-message-to-form#C37245

@sergeyklay sergeyklay self-assigned this Jul 27, 2016

@sergeyklay

This comment has been minimized.

Show comment
Hide comment
@sergeyklay

sergeyklay Jul 27, 2016

Member

Could you please provide Phalcon version and PHP

Member

sergeyklay commented Jul 27, 2016

Could you please provide Phalcon version and PHP

@qmegas

This comment has been minimized.

Show comment
Hide comment
@qmegas

qmegas Jul 27, 2016

Hello Sergey,

I'm the one who originally raised this problem.

I tested it on Phalcon 2.10 and PHP 5.6

qmegas commented Jul 27, 2016

Hello Sergey,

I'm the one who originally raised this problem.

I tested it on Phalcon 2.10 and PHP 5.6

@Izopi4a

This comment has been minimized.

Show comment
Hide comment
@Izopi4a

Izopi4a Jul 28, 2016

Contributor

i tested it on 3.0 with php7. I really dont know how to fix this tho

Contributor

Izopi4a commented Jul 28, 2016

i tested it on 3.0 with php7. I really dont know how to fix this tho

@Jurigag

This comment has been minimized.

Show comment
Hide comment
@Jurigag

Jurigag Jul 31, 2016

Member
$messages = $form->getMessages('name');

What exactly this means ? After changing it to more proper:

$messages = $form->getMessagesFor('name');

It works fine. I guess we should set this group somewhere in form - https://github.com/phalcon/cphalcon/blob/master/phalcon/forms/form.zep#L390 and work on it after setting it.

Member

Jurigag commented Jul 31, 2016

$messages = $form->getMessages('name');

What exactly this means ? After changing it to more proper:

$messages = $form->getMessagesFor('name');

It works fine. I guess we should set this group somewhere in form - https://github.com/phalcon/cphalcon/blob/master/phalcon/forms/form.zep#L390 and work on it after setting it.

@stale

This comment has been minimized.

Show comment
Hide comment
@stale

stale bot Apr 16, 2018

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

stale bot commented Apr 16, 2018

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

@stale stale bot added the stale label Apr 16, 2018

@sergeyklay sergeyklay closed this Apr 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment