smarty

How to only cache a portion of a page using Smarty Template (PHP) ?

How do I cache everything on a Smarty template page except for a small portion of the content (which is truly dynamic)? ...

Smarty AutoBind PHP Variables to Smarty Variables

In my smarty code I write a lot of code such as this: $smarty->assign('priorityList', $priorityList); $smarty->assign("groupview", $groupview); $smarty->assign('processList', key($processList)); $smarty->assign('taskList', $taskList); See how annoying it has become; I use the same name for Smarty variables and PHP variables, and yet I...

PHP5 include() Problem

Hi all, So, I've got task from my boss to install opendocman on our newly installed PHP5 running on openbsd. When I try to install opendocman on my ubuntu laptop (running 9.04) it was run smoothly. But, when I try to install in on server, I've got these error: Warning: include(templates_c/%%0E^0E4^0E407559%%footer.tpl.php) [function.in...

Sort question in Smarty in combination with eval

Smarty is used to render a select and handle the localization: <select name="divisions"> {section name=i loop=$divisions} {assign var='name' value=$divisions[i].name} {assign var='code' value=$divisions[i].code} <option value="{$code}" {if $user.division == $code}selected=yes{/if}> {eval var=$nam...

Caching of current user specific pages

We are using Smarty Templates on our LAMP site but my question would also apply to a site running Memcached (which we are planning to also bring online). Many of the pages of our user generated site have different views depending on who is looking at them. For instance, a list of comments where your own comments are highlighted. There...

PHP framework (cake/smarty): How to use it and when?

Duplicate of What is a PHP Framework? and many more So far, I've been using PHP for small tweaks, mostly with WordPress. What are PHP frameworks? Why do I need them? WHEN do I need them? Any insight will be helpful. Thanks. ...

smarty cache and login states

I was wondering. How do you guys deal with scenario of website where you have login and log out states at the top. So if someone is logged in, you say "Hello Scott". If someone's not logged in, it says "Log In". I am using force compile = false. And using (!$smarty->is_cached('index.tpl',$template_cache_id)) { do something } What do...

smarty.get no longer working

I have some old php code that has been working happily. I need to do some updating and have moved the code to another machine. Everything is fine except this smarty code no longer works. {$smarty.get.myvar} I know it must be to do with differnt config settings but i can't figure it out. Register_Globals is off on both installations....

Smarty plugin for NetBeans

I am looking plugin for work with Smarty in NetBeans. I need coloring of my code and normal syntax analysys. I could find only this plugin: Smarty Editor, but I could not make it work. Can you tell me about another plugin for Smarty or teach me how to install SmartyEditor? Edit: I use Windows XP SP3 ...

Smarty caching components

The Smarty FAQ suggests one way to handle cacheable fragments, but it needs each page controller to do tons of work up-front, instead of encapsulating things properly. We want to get to a stage where we can do something like: <div id="header"> {our_categories} {our_subcategories category=$current_category} </div> The output of th...

Smarty PHP/template output problem

I have problem outputing this to page.. for ( $i = 0; $mainarray[$i] != ''; $i++ ){ $query = mysql_query("SELECT ... FROM ... WHERE id=$i") or die(mysql_error()); while($tmp = mysql_fetch_assoc($query)) { $something[] = $tmp; } $smarty->assign('stuff'.$i, $something); } I could manualy do it like {section name=i loop=$stuff1...

What does the head of smarty cache files mean?

132 a:4:{s:8:"template";a:1:{s:10:"index.html";b:1;}s:9:"timestamp";i:1256373019;s:7:"expires";i:1256373079;s:13:"cache_serials";a:0:{}}<body> php<br > java<br > c++<br > </body> Can someone explain this part: 132 a:4:{s:8:"template";a:1:{s:10:"index.html";b:1;}s:9:"timestamp";i:1256373019;s:7:"expires";i:1256373079;s:13:"ca...

PHP Smarty - Get a list of all the variables in a template?

I'm using Smarty and PHP. If I have a template (either as a file or as a string), is there some way to get smarty to parse that file/string and return an array with all the smarty variables in that template? e.g.: I want something like this: $mystring = "Hello {$name}. How are you on this fine {$dayofweek} morning"; $vars = $smarty->ma...

basic in smarty

I m somewhat okay with why & where Smarty is used and also the upper hand it has over traditional PHP... but please tell me how is the separation of the application and the presentation parts needed as the definition itself says this about Smarty.. Please suggest some web sites where i can get some details in simple literature....... ...

basics in smarty for beginers

do Smarty and PHP go hand in hand.....and are these not two separate things...please tell me whats the main concept behind the separation of the application (the codings) and the presentation (the looks which includes the HTML tags) parts in Smarty ...

PHP/Smarty Shop Script Problem

Smarty Template and PHP.... I'm trying to get Shop-Script Free by Webasyst to display the same shopping cart on 2 different websites. I want to only use one admin section. I can get the categories, product names, product counts, prices and layout to display properly on both websites but I can't get the product images to show up on the ...

More than one value in Smarty {if}

Hy i have this code. {if $isModerator && $order->kind==1} bla bla {/if} and $order->kind can be 1,2,3,4,6 so making 5 if is not the idea any idea? ...

Is it possible to iterate over a multi-dimensional array in smarty?

Can someone provide a simple demo? I can't seem to get my head around the smarty syntax for iterating over an array that looks like the one below. I want to get at values at all levels. Array ( [0] => Array ( [id] => 0 [name] => 12312 [sub24] => Array ( ...

Extend base template in Smarty

Hello, Is it possible to extend a base template with another template in Smarty? I know this is possible in Django using the {% entend %} tag. Is there an equivalent (or workaround) in Smarty? Thanks ...

get top 3 result from foreach loop in smarty

I have an array to loop in smarty. My array look like this: Array( [0]=>( [title] = 'some title' [url] = 'image url' ) ).... I loop it in file .tpl and I just want to get top 3 result from this array. My array has the number of item larger than 3. I'm a beginner of smarty someone help me fix this problem. Thank you ver...