Skip to content
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

Test clearing form #12280

Merged
merged 5 commits into from
Oct 2, 2016
Merged

Test clearing form #12280

merged 5 commits into from
Oct 2, 2016

Conversation

@Studentsov
Copy link
Contributor

Studentsov commented Oct 1, 2016

Please, check the $form->render('field')

@sergeyklay
Copy link
Contributor Author

@Studentsov Could you please take a look?

@sergeyklay sergeyklay merged commit 3e5eeba into phalcon:3.0.x Oct 2, 2016
@sergeyklay sergeyklay deleted the clearing_form_elements branch October 2, 2016 00:32
@scrnjakovic
Copy link
Contributor

Phalcon 3.4.0

If you set the form itself as it's entity, calling clear() method won't have any effect as the form will still be populated with $_POST values. Is this intended behavior or bug?

$form->setEntity($form);

if ($form->isValid($_POST)) {
    echo $form->getValue('password'); // secret
    echo $form->get('password')->getValue(); // secret
    $form->clear();
    echo $form->getValue('password'); // secret
    echo $form->get('password')->getValue(); // secret
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants