macro n:ifcontent in manual rendering

Notice: This thread is very old.
Oggy
Member | 306
+
0
-

Hi,
I try to use the new macro n:ifcontent. How could I get an error of the particular manualy rendered input.
I found only this way:

<?php
<input n:name="email2" n:class="$form->getComponent('email2')->error ? error">
<span class="error" n:ifcontent>{$form->getComponent('email2')->error}</span>
?>

I'm sure there is an easiest way.
This:

<?php
<input n:name=name>
<span class="error" n:ifcontent>{$input->error}</span>
?>

doesn't work.

PHP 5.3.26
Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.8y DAV/2 PHP/5.3.26
Nette Framework 2.1.0 (revision released on 2013–12–31)

Jan Tvrdík
Nette guru | 2595
+
0
-

I think the following should work.

<input n:name=email2>
<span class="error" n:ifcontent>{$form[email2]->error}</span>
<input n:name=email2>
<span class="error" n:ifcontent>{$_input->error}</span>
Oggy
Member | 306
+
0
-

Thanks, that works.