Jump to content

foreach question (Theme)


cpt.price

Recommended Posts

I want to convert my 5.X theme to 6.2.X and it's find but i got problem in foreach loop

so my problem is get template variable in loop how i can get $ticket.date in for each loop ?

 

{foreach key=num item=ticket from=$tickets}

<tr>

====><td>{$ticket.date}</td>

<td>{$ticket.department}</td>

<td><DIV ALIGN="left"><img src="images/article.gif" hspace="5" align="middle"><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}">{if $ticket.unread}<strong>{/if}{$ticket.subject}{if $ticket.unread}</strong>{/if}</a></DIV></td>

<td>{$ticket.status}</td>

<td width=80>{$ticket.urgency}</td>

</tr>

{foreachelse}

<tr>

<td colspan="5">{$LANG.norecordsfound}</td>

</tr>

{/foreach}

 

i read http://docs.whmcs.com/Version_6_Template_Migration_Guide but still no luck.

can some one help me on this ?

if i want use this template in v6.2.X how should be foreach loop ?

Link to comment
Share on other sites

Hello,

 

Depending on how you template was integrated I'd recommend replacing all files (other than header.tpl, footer.tpl and homepage.tpl where you'll need to apply changes manually) with those of the new version and then apply any customizations to these maually.

 

Updating each file line by line would take much longer and there would be a high risk of bugs/errors with code missed.

Link to comment
Share on other sites

thanks to both of you.that was really helpful.i forgot to ask if i want to get ticket date with $temlate it would be ($template->getVariable('myVariable')->value) what ? $template->getVariable('ticket.date')->value or $template->getVariable('ticket','date')->value or ... ?

thank you in advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated