smarty Questions
1
Solved
In Smarty, it is possible to register an plugin in this way:
$smarty->registerPlugin("function","date_now", "print_current_date");
function print_current_date($params, $smarty)
{
if(empty($pa...
Sensualism asked 18/2, 2019 at 19:49
4
Solved
So I'm trying to modify the layout of theme.yml in a PrestaShop theme. I comment out the following:
hooks:
modules_to_hook:
displayFooter:
# - ps_linklist
# - ps_customeraccountlinks
- ps_co...
Ataractic asked 1/12, 2017 at 3:16
7
I would like to change the order of parent blocks in a child templates while using the content of the parent blocks.
Example:
parent template:
{block outer}
{block a} ... some long content ...{...
3
Solved
How to get URL using Smarty similar to window.location in JavaScript ?
I did this
{$smarty.server.PHP_SELF}
but it's not working.
Cassaba asked 30/10, 2012 at 12:13
4
Solved
I can't find a solution. What I've got to do is translate this:
se stai inserendo un indirizzo per consegna all'interno dell'area <span class=orange>EXPO</span>
into this:
If your d...
Defense asked 19/5, 2015 at 7:20
8
Solved
Im using the following Smarty code:
{foreach from=$entries key=i item=topic}
{if $topic.topic_style == question}
<li>
<a href="topic.php?id={$topic.id}">{$topic.title}</a>
&l...
4
Solved
How do you print all variables available in the context of a Smarty template? Something like the Django debug trace that lists everything being passed.
Thanks
7
Solved
Is there any function in smarty to check valid object of class in smarty?
Suppose $obj is having some value or not.
How to check $obj is object of 'TestClass' or not in smarty?
1
We have a plugin for a PHP script with Smarty template engine,
It can be used in template files with {plugin_name} but that requires making sure this is on every single template file, the question ...
2
Solved
I need to assign a variable which will be used to create the id label for some html elements.
And it needs to be unique.
I tried
{assign var=unique_id value=`10|mt_rand:20`}
and
{math equatio...
2
Solved
<div id="email_content">
<iframe srcdoc="{$email_content}"></iframe>
</div>
As shown in below picture I am using iframe inside div#email_content to show exact preview of e...
4
Solved
Is it possible to format a number to 2 decimal places with Smarty PHP?
Thanks.
2
Solved
I have a "links.tpl" file which contains lines with many variables such as below
{assign var=link_main value="index.php"}
{assign var=link_login value="?a=login"}
but when i include this file ...
Hodgkinson asked 11/12, 2012 at 6:26
3
Solved
How can I check the current iteration for foreach and do something?
{foreach $new_products as $product name=foo}
{if $smarty.foreach.foo.iteration=5}
Do it!
{/if}
{/foreach}
This always retur...
5
Recently, I put my project which is php+smarty+mysql in my httpd server. But I encountered an error that says:
500 Internal Server Error
My OS is archlinux, and the httpd server and php were ins...
5
Solved
I'm about to rewrite simple application where speed is very important.
Which approach is faster: using the pure PHP in the HTML files or using a template engines like Smarty or Twig?
Moreover, whic...
3
Solved
My problem is im creating a large nested PHP array which is parsing information from multiple external sources.
On the first return I would like to cache this data.
Im pretty new to caching so d...
6
Solved
I am not usually a Smarty guy, so I'm a bit stuck.
I want to echo the index of an array, but I want to increment it each time I echo it.
This is what I have...
<ul>
{foreach from=$gallery...
6
Solved
Smarty is complaining about permissions. I've written a small mvc framework for a project I'm working on and I need to be able to render templates in each controller. I went ahead and followed the ...
4
Solved
I got a problem with Smarty and constants. I got three constant especified in a file:
DEFINE('ARTICLE_COLOUR_10', 'Light green');
DEFINE('ARTICLE_COLOUR_11', 'Claret'); // Bordó
DEFINE('ARTICLE_CO...
6
Solved
I'm currently working on a very large project, and am under a lot of pressure to finish it soon, and I'm having a serious problem. The programmer who wrote this last defined variables in a very odd...
Mclin asked 4/6, 2010 at 0:47
4
Solved
In my prestashop a user (that is not a client or an admin) can create a "side" account (that is not a prestashop account) to do something special on the site.
I have created the everything to do t...
Draconic asked 10/11, 2014 at 9:58
5
Solved
I have an array in PHP that looks like this:
$config['detailpage.var1']
$config['detailpage.var2']
$config['otherpage.var2']
$config['otherpage.var2']
...
To access it in Smarty I would do
$sma...
3
Solved
I want to assign the value obtained from the concatenation of these two variables with a string.
{assign var="url" value="{$WS_PATH}aircraft_images/{$images[i].image}"}
Please let me know how ca...
Danialah asked 5/4, 2012 at 5:21
6
Solved
How to get last index value of foreach loop in smarty,i m new for smarty I have used this code but its not working
{foreach from=$cityList key=myId item=i name=foo}
{$i.location_name}{if $main_sm...
© 2022 - 2025 — McMap. All rights reserved.