Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

[urgent!!] Problem with Array appending a String

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
iriePub
Smarty Regular


Joined: 16 Jun 2006
Posts: 53

PostPosted: Sat Aug 05, 2006 7:45 pm    Post subject: [urgent!!] Problem with Array appending a String Reply with quote

Hi,

I have a Array with Templatefiles without the extension:

Code:

$ary = array('foo'=>'file1', 'bla'=>'file2', 'ttt'=>'file3');
$smarty->assign('sections', $ary);


no way to rewrite the array or something like that ...

and now, I want to do this:

Code:

{include file=$sections.bla.tpl}


This should include file2.tpl, but it doesn't. Smarty thinks, I want to access an element of the array $sections.bla (white is no array). I just want to append '.tpl' to the array-element.

How to do?

Thanks!!
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Aug 07, 2006 7:26 am    Post subject: Reply with quote

http://smarty.php.net/manual/en/language.syntax.quotes.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP