Snippet container definition

Notice: This thread is very old.
darthcz
Member | 113
+
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)

mkoubik
Member | 728
+
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).