Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

function join with smarty - very urgent

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
livingdead
Smarty Rookie


Joined: 08 Oct 2003
Posts: 9

PostPosted: Wed Oct 08, 2003 2:22 pm    Post subject: function join with smarty - very urgent Reply with quote

How can I do join with smarty

thanks for your helps

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


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

PostPosted: Wed Oct 08, 2003 3:28 pm    Post subject: Reply with quote

you mean php's join?

{','|join:$var}

with $smarty->security=false (the default) you can use any php-function as a modifier.

if you don't like the strange order of parameter above you have to write a modifier-plugin as a wrapper:
modifier.join.php
[php:1:63627a1f22]
function smarty_modifier_join($array, $delimiter) {
return join($delimiter, $array);
}
[/php:1:63627a1f22]

then you can do
{$var|join:','}

HTH
messju
Back to top
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Oct 08, 2003 6:39 pm    Post subject: Reply with quote

Why do I get the sinking feeling that SQL join is meant? In which case, the answer is: you don't.
Back to top
View user's profile Send private message
livingdead
Smarty Rookie


Joined: 08 Oct 2003
Posts: 9

PostPosted: Tue Oct 21, 2003 9:15 am    Post subject: Reply with quote

thanks for your reply, sorry for mylate to be back, but I did other thinks, in waiting.


What is permited if you leave $smarty->security = true;

Which sort of hacking is possible

Thanks for your help

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


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

PostPosted: Tue Oct 21, 2003 9:29 am    Post subject: Reply with quote

read: http://smarty.php.net/manual/en/variable.security.php

(btw: you don't *leave* it true. it false by default)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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