smarty

[Smarty, and maybe doctrine]

Hi everyone, I'hv got a problem when I am using foreach in smarty, an array with 2 item was loop in a foreach, but the result is it loop 3 time. I use doctrine to get a list of review by a user from database Doctrine_Core::getTable('review')->findByUser($userId); then I assign it to smarty and loop in foreach: {foreach from=$r...

Smarty change elements in array

I have an array in my template files ($data) witch looks like this $data.1.name $data.1.date $data.1.place $data.2.name $data.2.date $data.2.place $data.3.name $data.3.date $data.3.place now I would like to check the entire array and remove an item where the date is older then today. The date check i figured out but i'm stuck at remov...

Social Engine Zend Framework - Dynamic Ajax dropdown for Country / State / City

Hi Friends, I am working with Social Engine which is based on Zend Framework and Smarty Templates. I need to make custom functionality for profile page, where I need Ajax based Dynamic Country / State / City selections like Dropdown for Country -> on selection of some country, State will display belonging to selected country and Stat...

Smarty reading last x numbers of rows of an array

I need to read for example last 3 items of an array in smarty. Please advice. ...

Codeigniter with Smarty causing an error

I'm using Smarty_parser.php and it works well when when I use the parser by itself or if I run the parser then a view call. For example: public function act() { @$this->load->library('smarty_parser'); $data = array('Someinfo'); $this->smarty_parser->parse('contentTmpls/act.tpl', $data); // Load Footer $this->load->vi...

looping through a multi-dimensional array in Smarty

I have a multi-dimensional array generated in PHP: array( 'Requirements' => array( 'export_requirements' => array('value'=> 1, 'label'=> 'Export'), 'add_requirements' => array('value'=> 2, 'label'=> 'Add'), 'add_private_requirements' => array('value'=> 4, 'label'=> 'Add Private...

php+zend..pass parameter in request

hello, i want to pass parameter along with my add action.that is if owner in menu item is clicked then "is_owner" should by default get set otherwise reset..along with "add" want to send one more parameter and access it in view.this is request dispatcher.. $router->map('Company', 'Company', array('controller' => 'companies', 'action' =...

How to do assignment in smarty?

I tried this way,but seems not working: {if $i == 1} $value = $recommend[3]; {/if} Does smarty support assignment operation? ...

How to make smarty output error info?

Seems by default smarty eats up all errors(even nothing in php's log): {$value|nosuchapi} How to make it output error info when it calls an function that doesn't exist? ...

how mvc+smarty in php works?

this is a handler for building menu new MenuItem('Owner', lang('Owner'), assemble_url('Owner'), get_image_url('navigation/Company.gif')), new MenuItem('Client', lang('Client'), assemble_url('Client'), get_image_url('navigation/people.gif')), One system module class in which i've mapped the route $router->map('Owner', 'Owner','nu...

What's the difference between {foreach} and {section} in smarty?

Can someone provide an example that make it clear? ...

How to do this kind of templating in a single loop in smarty?

<ul> {foreach from=$recommend item=value} <li><span><em>{$value['content']}</em></span></li> {/foreach} </ul> <ul> {foreach from=$recommend item=value} <li><h4>{$value['name']}</h4></li> {/foreach} </ul> The above html can be generated by 1 loop if not using smarty: $html1 = $html2 = '<ul>'; foreach($recommend as $value) { $html1 ...

Any Smarty Users out there? Here's a domPDF challenge.

I have a working dynamic content query/echo file that I need to convert to template for use with domPDF. Would someone look at my code that's not executing to see where I'm going wrong? (Btw, the sendPDF.tpl file is in path: /Smarty/mg/templates/ -- sendPDF.php is in /Smarty/mg/ and smartyTEST.php is in my root path) thanks much Allen ...

In server the site is not loading which is developed using PHP and MYSQL and with smarty Framework

Hi all, I developed a project using PHP as FRONT END and MYSQL as BACKEND using SMARTY FRAMEWORK. In my localhost the site is working perfectly. But in server it doesn't load. Here is the URL : http://utovglobal.com/new_mandapam/ I give permissions to all the folders. Even it didn't work. Any suggestions or help will be thankful an...

Javascript prototype.js: How to pass parameter to callback function

Not much knowledge about Javcascript beyond using it for some Dynamic HTML. Now I'm venturing a bit into Ajax ground and have a problem with the following code (borrowed from http://kpumuk.info/php/ajax-enabled-smarty-plugins-part-2-ajax_form/ and edited to fit my needs). How can I pass the update_id parameter to the obSubmit function? ...