Snippet container definition

5 years ago

darthcz
Member | 114
+
0
-

I would appreciate if I can define snippet block in form definition not only in template because if I need to invalidate only captcha field (TextBase), whole form needs to be defined in template.

I think it hasn't to be as much difficult. It could be one new container type and condition in renderer. If the container type is snippet, render snippet block with given name.

Something like this:

$snippetContainer = $form->addSnippetContainer('captcha');

$snippetContainer->addCaptcha('captcha');

Last edited by darthcz (2013-08-25 21:24)

5 years ago

mkoubik
Generous Backer | 733
+
0
-

I think you would have to use your own macro, because {control form} compiles to $form->render() and snippets cannot be defined in runtime (only in compile-time).