For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > October 2006 > assign template var with number of elements of an array









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author assign template var with number of elements of an array
Nuno Mendes

2006-10-20, 7:04 pm

Hi,

I'm trying to create a variable inside a template (banners_count) and
it's value needs to be the number of elements of an array. I am using
this but it's not working.

{assign var=banners_count value=count($banners)}

How can it be done?

Thanks!

Nuno
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com