Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active September 14, 2018 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kcko/8777baec32bf6ce3ef451975763ba7e9 to your computer and use it in GitHub Desktop.
Save Kcko/8777baec32bf6ce3ef451975763ba7e9 to your computer and use it in GitHub Desktop.
<?php
->addCondition(function() use ($form) {
return ...; //true nebo false
})
<?php
1)
$videoLength = $video->addText('videoLength', 'Délka videa');
$videoLength->addConditionOn($form['article-published'], Form::EQUAL, TRUE)
->setRequired();
$videoLength->addCondition(Form::FILLED)
->addRule(Form::PATTERN
2)
$video->addText('videoLength', 'Délka videa')
->addConditionOn($form['article-published'], Form::EQUAL, TRUE)
->setRequired()
->endCondition()
->addCondition(Form::FILLED)
->addRule(Form::PATTERN, 'Délka musí být zadána ve formátu minuty:sekundy', '[0-9]+:[0-9]{2}');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment