SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    Maniacally depressed robot poncho's Avatar
    Join Date
    Dec 2004
    Belfast, N.Ireland
    0 Post(s)
    0 Thread(s)

    Question Smarty syntax help

    Hey guys,

    I'm having a syntax problem with Smarty's {section} function.

    I have an array being passed to smarty (it's actually a QuickForm date element with three sub-elements, d M & Y) and would like to loop on that according to a set number:

    The entire form is assigned to 'form_data' smarty variable.

    <span>{$form_data.eventdates.label}<br />
    This outputs the date element as:

    <select name="eventdates[d]">
    <!-- options here //-->
    <select name="eventdates[M]">
    <!-- options here //-->
    <select name="eventdates[Y]">
    <!-- options here //-->
    I need to duplicate this as many times as is needed according to the {$num_dates} variable.

    If I do it with the html renderer I get (pseudo-code):
    Can anyone help me get the same result with Smarty? I just can't seem to get it working

    I've got a rough example up on of the form using the default renderer. Any help would be appreciated.

    Thanks in advance;
    Last edited by poncho; Sep 10, 2005 at 04:09. Reason: Added example code
    Perfecting the art of breaking stuff.
    Check 'em: CakePHP | TextMate


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts