smarty

php $_REQUEST data is only half-decoded

I am retrieving an encoded url via querystring. I need to pass it again to the next page. When I retrieve it the first time, using $_REQUEST['url'], only the slashes are decoded, e.g: http://example.com/search~S10?/Xllamas&searchscope=10&SORT=D/Xllamas&searchscope=10&SORT=D&SUBKEY=llamas/51%2C64%2C64%2CB/browse Th...

Include HTML file into Smarty .tpl file.

{if $loggedin} {literal} {include file="allhead.html"} {/literal} {else} {literal} {include file="allhead1.html"} {/literal} {/if} How do I include the code contained into an HTML file in a smarty .tpl file? I've tried different solutions on various forums, but none work. ...

certain Smarty tags don't work in OpenX templates

I am on a team that is developing an OpenX plugin, and I am responsible for the UI. I noticed that if I use certain Smarty tags in my template, the app doesn't work and I see an error message, similar to this: Plugin by name 'Html_select_date' was not found in the registry; used paths: default_views_helpers_: /openx/www/admin/plugins...

How to read smarty config variable from PHP behind?

What function can I use in PHP for class Smarty which reads a variable's value from the Smarty's config file? Here's my code: <? session_start(); require('libs/Smarty.class.php'); $smarty = new Smarty; $smarty->config_load("settings.conf"); include('settings.php'); include('meta.php'); $smarty->debugging = false; $smarty->caching...

What's the difference between Smarty and Zend?

I came upon Smarty which is a template engine. But there are also the Zend, CakePHP frameworks. Is Smarty like Zend, or are they completely different? Smarty just separates logic from display - is this similar to a framework like Zend? ...

smarty: {if div with class="one" is enabled, (HTML snippet1) Else (HTML snippet")

Hi, on the site I'm working on, I need to show two different HTML snippets depending if another element is activated or not. Like: {if "div class="box expandResults" is enabled(or appearing on the page)"} ....HTML.... {else} ....OTHER HTML.... {/if} How can I do this with Smarty or jQuery? I only have access to the .tpl files. ...

Jquery function doesn't work (with smarty).

Hi! I can't find whats the wrong with this script. Please help me! {elseif $text[i].text == "%SubPages"} <!-- js--> {literal} <script type="text/javascript"> $(function(){ $("#button_{/literal}{$text[i].id}{literal}").click(function(event) { event.preventDefault(); $("#settings_{/literal}{$text[i].id}{literal}").toggle(); }); $("#setti...

How to check a complex condition in Smarty(PHP)

I need to display a section or another in a smarty template. My condition is simple: if a smarty value starts with a string I should display one section, otherwise the other smarty section should be displayed. I can change only the tpl files. {php} if (substr($url,0,4) != 'http') { {/php} section 1 ...

Find where a variable is defined in PHP (And/or SMARTY)?

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 way - the config variables aren't all in the same file, they're spread out across the entire project of over 500 files and 100k+ lines of cod...

How to dynamicly apply variable modifiers in Smarty 2.x

Hi, I can't find the solution of applying modifiers dynamicly in Smarty. Template - I would like to work this way (example) {$myVariable|$modifiers} Php script $smarty->assign('myVariable', "brumla brumla na drum drum drum"); $smarty->assign('modifiers', "truncate:30|trim"); Or I would like to apply modifiers in php - is there any...

Returning a reference from a Class member?

Hi, I've a class that basically looks like this: class App { public function newTemplate($filename, $vars=array()) { $smarty = new Smarty; $smarty->compile_dir = $this->template_compile_path; if(count($vars) > 0) { foreach($vars as $v_key => $v_name) { $smar...

How to cast a value as integer in Smarty

Im having a little trouble in referencing indexes in arrays in Smarty. I believe that it is because the variable I am using as the index is a string. How may I cast this string as a integer within the template? Thanks. ...

advantage and disadvantage of smarty template

Possible Duplicate: Why should I use templating system in PHP? Hi , New to smarty , Why people's showing interest in framework , What are the advantages in that , also lot of people little bit avoiding template what is the reason , What is the real reason people choosing the smarty , How much really smarty best for web...

Tell smarty to print block as is

Hello guys, I need to inline some javascript code into the Smarty template files and these {ldelim} {rdelim} things are killing me. Is there a way to tell smarty to ignore the markup for a block and just output it as is? Something similar to CDATA blocks in the xml? Just in case: here is how simple javascript looks now: $(function() ...

Frontend Intertag Communication

Hey all, I've had a question that I've been wondering for a while. I'm making a templating system for front-ends where tags are interpretted (like Smarty). I was wondering if there is value in having the tags be able to communicate with the HTML document and other "Smartyish" tags. I was hoping that the community would have some thought...

can we use smarty with zend framework?

Any body know can we use smarty with zend framework. If yes what is the advantage of using like that? ...

Smarty template tag to check for FIRST user login - to pass message on initial login

Hello, I usually don't use Smarty but am in the process of editing a prebuilt app, that uses Smarty for templating. It's super easy to check for the login status, but I have searched the Smarty site, docs and the app vendors docs and cannot find a tag of function to check for the initial user login. We need to pass a message to the user ...

smarty, send to file date

I have in a PHP file this array: array(1, 2, 3); How can I send this array to a Smarty .tpl? ...

how to set array element/sort array in php

Hello All i want to sort the array in the way that ASC order of user id there is array like $user i want to sort on the base id $user['role'] =1; then that element will set at the top of the array ...

update array smarty

Hi, in smarty i have this array: {$user} Array (3) 0 => Array (2) id => "1" name => "Peter" 1 => Array (2) id => "2" name => "Joy" 2 => Array (2) id => "3" name => "Sandra" How i can update this array(with php)? Insert new element, age: Array (3) 0 => Array (2) id => "1" name => "Peter" age => "16" 1 => Array (2) ...