SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smarty Template syntax error

    If you want the full code --> http://pastebin.com/m6ca41d10

    PHP Code:
    {foreach from=$completed_semester_classes key=a item=b}
            <
    tr class="{cycle values='odd,even'}" style="font-size:0.8em;">
                    <
    td>{$form_data.{$a}_complete_sem.html}</td>
            </
    tr>
    {/foreach} 
    Gives me the error:
    Code:
    Fatal error: Smarty error: [in /apps/home/psychology/admissions_1.0/public/view/templates/admission.tpl.php line 90]: syntax error: unrecognized tag: $form_data.p{$a (Smarty_Compiler.class.php, line 446) in /apps/home/itwdid/lib/Smarty-2.6.18/libs/Smarty.class.php on line 1095
    How can I get Smarty to recognize that I'm wanting to include the key of my array as part of the object I'm trying to call?

    I'm trying {$form_data.p{$a}_complete_year.html} to accomplish {$form_data.p103_complete_year.html} and so on.
    Last edited by apinomus; Dec 4, 2007 at 13:23.


Bookmarks

Posting Permissions

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