smarty

smarty escape single quote in if else condition

Dear all, need some help from smarty expert. I am new in smarty template engine. I would like to escape a single quote in a string, how can I do that inside my .tpl I got a if else condition $current_category.category eq 'King's Tea' the problem is the 'King's Tea' , that is my category name, I tried 'King\'s Tea' , Smarty can't c...

how to find a key of array in smarty

hii to all..i am new to smarty..and i didnt look depth in smarty..i had an array.how can i get a particular key value as a string in smarty.. thx in advance. ...

Smarty Relative include path

File structure is as follows: index.php settings/ |-manage_account.php templates/viriditio-v2/ |-index.tpl templates/virditio-v2/css |-style.css localhost/~braden/virditio/index.php shows the template like expected showing index.tpl with the style sheet paths correctly showing: <link rel="stylesheet" href="templates/virditio-v2/cs...

Prestashop Code Blocks

I've been thrown in at the Prestashop deep end, have a couple of questions and wondered if anyone could help. I need to add fields to a form. This form was marked-up by me, then somehow integrated into the shop. I've found the CMS page with the form on it, and the following tag is inserted to display the form: {brochure_request_form}. ...

Does smarty works fine when APC is installed ?

Hi everybody. I'm developing my website using Php and Smarty. Now , i'd like to caching the bytecode of the php script using APC, but i'm worry that APC will cache also the complied smarty's templates, loosing the possible dynamic content. Is it possible? Tanks ...

What does it take to make a CMS template work on a normal website

A PHP content management system usually has its own template engine be it smarty or some other custom template engine specific for that CMS. How might I possibly get a CMS theme to work on a normal PHP website without converting the website to a website powered by that CMS? Can I "teach" the website to use the template engine of a cont...

Eclipse, PHP and Smarty

Hi, Can anyone suggest me a solution for the above mentioned combination. I'm using Eclispe Helios SR1 with latest PDT from Zend and Aptana Studio 2 Eclipse plugin. Otherwise it all works well, with Aptana Editor for HTML/Template files and PDT for PHP stuff, but Smarty syntax highlighting on templates would be nice. Is there anyway to ...

the blank space below the <body> tag & script tag and link tag goes under body tag from head tag

hey guys, i wrote a php app using php+smarty. when i view web source code in firebug, i find that link tag and script tag get under the body tag. but i should be under head tag. and there are some space below body tag. and there's blank space on my top of my web page. so , what's the problem? ...

What to use for localization (php/smarty/pear application) ?

Hi all, I have a php/smarty/pear app that has it's own localization implementation that involves using ids for strings and the strings are stored in a db. currently the app is only in English but I will start adding other languages. The current implementation is very poor and basically I'm not a big fan of re-inventing the wheel. Can a...

Smarty current on associative array

Hi, i have an associative array and i am trying to get the first record with smarty. In php i use current(array), but smarty dont seems to have current. So i wrote the code below {if is_array($browseProducts.data) } <ul class="products-grid"> {foreach from=$browseProducts.data item=item} {assign var='image' v...

Is it possible to put variables inside config files?

Hi! I use smarty to allow different languages on my site, which works OK so far. I store the texts in config files in different sections. But then there are sentences like this: "You have 6 new mails!", which would be in german "Sie haben 6 neue Mails!" Now there's text before the number and behind the number, which is loaded from ...

Smarty Master Pages

How can I create Master Pages like in ASP.NET using PHP and Smarty? I want to have several content place holders in the master page and simply fill them with almost big HTML chunks. So I'm looking for a better approach than what I currently have. $content =<<< eol <div id="home"> <img src="images/jon.jpg" id="left-image" />...

question in html_checkboxes loop index in smarty template

hello ,, i want know how to get the index of html_checkboxes loop index with smarty for each checkbox ?? http://www.smarty.net/manual/en/language.function.html.checkboxes.php ...

php,mysql , and smarty. Confused by a "{" in social-engine platform

hi I was looking at a php code from social engine and they have something like this: header("Location:user_event.php?event_id={$event_id}&justadded=1") why id it not header("Location:user_event.php?event_id=$event_id&justadded=1") or header("Location:user_event.php?event_id=".$event_id."&justadded=1") because the value of $even...

How should I integrate some javascript into a php application?

I have a medium size legacy php application with almost no javascript integration. I've recently been learning javascript (yes actually learning it) using Douglas Crockfords excellent book and taken YUI as my library of choice. I've tried out a few things and got a few things working but now I want to integrate the various components e...

PHP Web Design: Using Smarty vs Rest feeds with jQuery

I've been trawling SO for a couple of hours tonight looking for some answers, but I've not found anything that really answers what I'm after. My apologies if it has, in fact, been answered already. I'm designing a new website and I'm trying to decide on the architecture to use to serve the content. In the past, my websites have used PHP...

If-clause in a foreach loop at Smarty-template-system

I use Smarty as a template system in a script of mine. There is a page with drop-down-boxes (to select a music genre) and the form is reloaded with an on-change event. The value of the drop-down-boxes are transfered via GET. The drop-down-boxes should have the value selected before. The PHP-Code concerning the GET code is $get_ge...

Is there anything like Dwoo-s {with} or {loop} in Smarty 3 or earlier?

{with} and {loop} plugins in Dwoo template engine change default context for variable name resolution. If in Dwoo you feed template: {$arr.foo} {with $arr} {$foo} / {$arr.foo} {/with} with data: array('arr' => array( 'foo' => 'bar' )) it will output: bar bar / because second {$arr.foo} actually means {$arr.arr.foo} in global c...

smarty get data from $globals

If have used {debug} to see what data i can access in a page. Now the stuff i need sit's in {$GLOBALS} like current_user => Array (17) id => 3759 user_name => bla email => [email protected] group => Array (2) id => users caption => Users But how to i get the data i need to show on my page? Like th...

including a form element in a .tpl file

Hi, I am using a custom php frame work . i use smarty template engine . i start create a form within the controller file and i introduce a form element in .tpl file using html_checkbox . But this element cannot be found when i submit the form . how do i make the .tpl content part of the form . ...