On 16.04.2011 20:39, oscar balladares wrote:
> Hi. You must use the 'length' filter:
> 
> {{ entry|length }}
> 
> That must do the trick.

That will check the length of the array, if it exists. To check whether
entry.children is there, you need to use:

{% if entry.children is defined %}
  children
{% else %}
  no children
{% endif %}

If it can be defined and empty, then you can use:

{% if entry.children is defined %}
  {% for child in entry.children %}
    children
  {% else %}
    no children
  {% endfor %}
{% endif %}

Cheers

-- 
Jordi Boggiano
@seldaek :: http://seld.be/

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to