nette / forms

📝 Generating, validating and processing secure forms in PHP. Handy API, fully customizable, server & client side validation and mature design.
https://doc.nette.org/forms
Other
497 stars 147 forks source link

Latte macros {label} and {input} ignores custom form renderer #32

Closed peterpp closed 9 years ago

peterpp commented 10 years ago

Let's have a form with custom renderer:

$form->setRenderer(new CustomFormRenderer());

and this latte template:

{form customForm}
    {label name /}
    {input name}
{/form}

Than CustomFormRenderer is not applied while rendering label and input.

Here is a quick workaround:

{form customForm}
    {var $label = $form->renderer->renderLabel($form[name])}
    {$label}
    {var $control = $form->renderer->renderControl($form[name])}
    {$control}
{/form}

Something like this should be generated automatically.

dg commented 9 years ago

This is intentional behavior.

rauwebieten commented 5 years ago

You can call $form->renderer->renderPair($form[name])