Hi,
I'm using a smarty template for a multi-language website. I got an array of country that is order by country code, which is ok for the english version as country name are in the right order but no ok for other languages (for example United Kingdom stay in the "U" whereas in French it prints "Royaume Uni".
Is there a smarty function...
hi ,
i'm using Smarty with my php code and i like to cache some of website pages so i used the following code :
// TOP of script
ob_start(); // start the output buffer
$cachefile ="cache/cachefile.html";
// normal PHP script
$smarty->display('somefile.tpl.html') ;
$fp = fopen($cachefile, 'w'); // open the cache file for writing
fwri...
I have WHMCS installed, and am editing the templates (Smarty). I cannot get the sIFR js to work. I have read all the relevant questions here, and I've read the tutorials on sIFR v. 2 and v.3. Right now I'm on hte latest nightly build with sIFR so that I can use the font. I did however, generate the font online stead of using a flash ...
I searched google, but coulding find anything. Checked the documentation too...
I thought Smarty allowed PHP to be written inside the template itself if you escaped the template engine?
...
How to push new images in a web application, so that the cached is not taken?
When I am having a new JS or CSS file, it's easy.
Because they are in smarty templates, and I am having a version number in the URL (like a.js?v=9).
Now, the problem with images are: -
They are referred from the CSS files, and I can not have a version variabl...
I have a php web application on web server connect with two oracle db server in loadbalance between them... we use in web application smarty template engine ..and ajax jquery
the problem in
- when more clients connect the web application the site stop or apache not running so we make restart to apache.
- some web pages is slow.
i want ...
Hi,
for our latest project we used Django, where one can specify a list of folders, that are searched for a template, say, with name example.html. Now, we switched back to Smarty (PHP) and are wondering, if there is something similar.
Smarty version: Can be cutting-edge.
Behaviour:
Feed Smarty with an array of folders.
Call a templa...
These are two of the options I have for exposing a PHP object to a Smarty template. I know that there are syntax differences between the two, but I can't find any information on why you would use one over the other. Can anyone explain the differences?
Thanks,
James.
...
Hi,everyone,
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 installed like this:
sudo pacman -S apache php
If I use a test native php file which contains the following:
<html>
<head...
Hey all,
Just a general question for those of you working with the Smarty templating engine.
How are you setting up your file structure? I'd like to follow an MVC format, but I'm not sure how to include all the CSS, Javascript, etc. with the Smarty controller and templates without including these ridiculous paths.
Has anyone worked wi...
hi when i open my site (made in smarty) i got this error plz resolve im very new in smarty
Smarty error: unable to read resource: "pagetemplate.tpl" in /var/www/vhosts/example.com/htdocs/includes/smarty/Smarty.class.php on line 1083
Warning: Smarty error: unable to read resource: "pagetemplate.tpl" in /var/www/vhosts/example.com/htdocs...
Given a Category (parent) and Product (child) tables in a database, say, I want to create Smarty Block Plugins that would enable template snippets similar to this:
{products category="Some Category"}
<h1>{products_name}</h2>
<p>{products_description}</p>
{/products}
I believe plugins like these would help avoid repeated chunks...
Apologies for the very basic question - crash course in javascript coming up! But before that, I have a javascript function:
function toggle(request)
The function simply toggles a div as visible/invisible. I can trigger the behaviour I want from this function using an onclick event as follows:
<input type="radio" name="complete" val...
Hey all,
I'm messing with using AJAX to fetch "partial templates" from the server and echoing them back to the browser. This will cause all this HTML to have to be sent back to the browser. I was wondering if there is a way to simply change the variables but leave all the html there. Something like this:
$smarty->assign("fruit", "apple...
I'm trying to implements selection lists using Smarty and I'm aware of the {html_options}. The application must support localization (which I implemented as described in this post).
Is it possible to combine the two?
I'm currently handling it by parsing through the items with {section name=i loop=$list} and "manually" generating the HT...
Hello all, I got a problem regarding how to assign a java script variable to a smarty variable. Here is the code snippet.
function getDateInfo(date, wantsClassName)
{
var as_number = Calendar.dateToInt(date); //This as_number is the variable which should be assigned to smarty variable
}
How can i accomplish t...
Hello all,
I am in need to display all the Countries List in ASC order. But with a line inbetween every end of alphabets. This is by using PHP and SMARTY
Example:
America
Australia
Belgium
India
Like the above i need to display the O/P.
My query is
$str = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,Y,Z';
$let=explode(',',...
Hi,
In Smarty, is there a standard function or an easy way to parse json from an array, as json_encode() does in php? Actually It seems there is not in smarty documentation but wanted to ask anyways.
Thanks,
Sinan.
...
If in a php file you had:
$smarty->assign('content','<p>This is some test content</p>');
and in a template file I hadb (just for example purposes):
<html>
<head></head>
<body>{$content}{config_load file='settings.conf'}{#setting1#}</body>
</html>
Would it be possible to load the setting from the config file, from the php file inste...
I'm using a Smarty template for my web application Registration / Sign-up form.
The form is slow to load, can I cache the registration form in order to speed up the loading of the page?
On the form page, I use SESSION and do lots of PHP error checking to ensure that the form fields are completely & correctly inputted. If not, I redis...