Skip to content

Conversation

@f3l1x
Copy link
Member

@f3l1x f3l1x commented May 28, 2018

  • new feature: yes
  • BC break? yno
  • doc PR: not yet

Ability to reset already attached rules on control. It's not possible to attach different rules in modular systems. Or is it?

$form = new Form;
$input = $form->addText('text');
$input->addCondition(Form::MAX_LENGTH, 5)
	->addRule(Form::PATTERN, 'Musí obsahovat číslici', '.*[0-9].*');
$input->getRules()->reset();

Reset method is marked as internal.

@dg
Copy link
Member

dg commented May 28, 2018

Why internal?

@f3l1x
Copy link
Member Author

f3l1x commented May 29, 2018

It looks similar as check method. But you're right, it shouldn't be @internal.

@f3l1x
Copy link
Member Author

f3l1x commented Jun 2, 2018

What do you think @dg ?

@dg
Copy link
Member

dg commented Jun 3, 2018

I think that you should remove annotation internal, because that method is not used anywhere :)

@f3l1x f3l1x force-pushed the feature/reset-rules branch from 28a7ecc to 4994616 Compare June 4, 2018 05:08
@f3l1x
Copy link
Member Author

f3l1x commented Jun 4, 2018

Done.

@dg
Copy link
Member

dg commented Jun 4, 2018

Great

@dg dg merged commit be85f75 into nette:v2.4 Jun 4, 2018
dg pushed a commit that referenced this pull request Jun 4, 2018
dg pushed a commit that referenced this pull request Jun 4, 2018
dg pushed a commit that referenced this pull request Jun 7, 2018
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.

2 participants