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

Fix #706 add two param for \Phalcon\Forms\Form::add #1386

Merged
merged 2 commits into from
Oct 17, 2013
Merged

Fix #706 add two param for \Phalcon\Forms\Form::add #1386

merged 2 commits into from
Oct 17, 2013

Conversation

dreamsxin
Copy link
Contributor

See #706

$form = new \Phalcon\Forms\Form();
$form->add(new \Phalcon\Forms\Element\Text('name'));

$form->add(new \Phalcon\Forms\Element\Text('before'), 'name', true); // add before
$form->add(new \Phalcon\Forms\Element\Text('after'), 'name'); // add after

@Cinderella-Man
Copy link
Contributor

Hi,

I don't want to bring bad news again but I would advise to stick to add () method and extend it as it was proposed by @mitris. Second and third param should be simply optional where second defaulted to Form::POSITION_APPEND.

Thanks,

Kamil

@dreamsxin
Copy link
Contributor Author

@Cinderella-Man I thought about it, if do not add new methods, then the second and third arguments parameter position is best for the replaced.

   $form = new \Phalcon\Forms\Form();
    $form->add(new \Phalcon\Forms\Element\Text('name'));

    $form->add(new \Phalcon\Forms\Element\Text('before'), 'name', true);
    $form->add(new \Phalcon\Forms\Element\Text('after'), 'name');

phalcon pushed a commit that referenced this pull request Oct 17, 2013
Fix #706 add method addAt for \Phalcon\Forms\Form
@phalcon phalcon merged commit 5d1a132 into phalcon:1.3.0 Oct 17, 2013
@phalcon
Copy link
Collaborator

phalcon commented Oct 17, 2013

Thanks

@Cinderella-Man
Copy link
Contributor

@dreamsxin thanks for changing this. Great job

@dreamsxin
Copy link
Contributor Author

@Cinderella-Man Frankly, it should be done

@dreamsxin dreamsxin deleted the form branch August 20, 2014 07:56
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