473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SMARTY template array search

I have a few arrays in SMARTY with different values in them and need to know the best way to figure out which array a value is in as it loops over it. Basically array_search for smarty but I don't know if that's a function or how to best reproduce that in SMARTY.

Thanks,
Andrew
Jul 29 '10 #1
2 5000
dlite922
1,584 Expert 1GB
If it doesn't exist? create your own:

here's a tutorial how:

http://www.velvetblues.com/web-devel...tom-functions/

Your custom will just be in PHP and uses array_search and passes back the output. It will be just basically a wrapper to the PHP array_search.

Cheers,



Dan
Aug 3 '10 #2
Thanks! That's a great resource and I appreciate your pointing me there!
Aug 3 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Brian | last post by:
Hello, I am trying to work out how to have smarty use a string's contents as the display-> template.. ie: $smarty->display($buffer); obviously $buffer isn't a filename, but a smarty template...
2
by: Brian | last post by:
I have an application that uses an array of values as a "lookup" table and smarty as a template engine. $lookup = "label"; $lookup = "label2"; $lookup = "label"; $lookup = "label2"; In my...
0
by: Martin Meng | last post by:
Is Smarty really secure enough to open up the template source to members from the general public (albeit registered user, screened, identity verified)? My application calls for customiszble...
1
by: JD | last post by:
This code; {if "sitethumbs/thumbs/{$user.login}.jpg"|smarty_exists} something here {/if} gives me; Parse error: parse error, unexpected T_STRING in...
10
by: Craig Keightley | last post by:
I have the following array: function showCPUs(){ //name brandID dualCore dualProcessor var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=;
0
by: Conrad | last post by:
Hi, I'm very new to Smarty Template Engine and I'm using PHP 5.0.4 on the Windows XP Professional platform and I have the following question: When I change the 7th line of the script to use a...
2
by: cshih16 | last post by:
my php file contains: $smarty->template_dir = BASE_DIR.'templates/'; $smarty->compile_dir = BASE_DIR.'templates_c/'; but still get error: unable to write to $compile_dir '/home/templates_c'. Be...
1
by: cyrvb | last post by:
Hello, I'm a very very newbie in C# I did start 2 days ago, I get Visual Stuido 2005 C# I try to understand how to manage the arrays I did write this
10
by: Man-wai Chang | last post by:
I added the following to the sample.tpl.html, but no "haha" was printed! <?php echo "<p>haha"; ?> -- iTech Consulting Services Limited Expert of ePOS solutions Website:...
3
by: tomerdr | last post by:
Hi, I have been asked to create a dynamic template array as an exercise. the array should be used as follows: CDynamicArray<City*arr; or CDynamicArray<Streetarr; It also need to support...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.