Re: [SMARTY] How to pass quotes in a encoded format?
| From: | Daniel Cummings | Date: | Mon, 22 Dec 2003 17:00:06 +0000 |
| Subject: | Re: [SMARTY] How to pass quotes in a encoded format? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10738@lists.php.net to get a copy of this message | ||
monte,
of course, you mean:
{$myvar|escape:"url"}
as it is shown in the manual:
http://smarty.php.net/manual/en/language.modifier.escape.php
dan
On 12/22/03 11:47 AM, "Monte Ohrt" <monte@ispi.net> wrote:
> Smarty doesn't change anything without explicitly telling it to. I'll
> bet this has already happened before you assigned it.
>
> As for URL encoding, you can format your string with Smarty like this:
>
> {$myvar|encode:url}
>
>
>
> On Mon, 2003-12-22 at 08:09, Netto wrote:
>> Hi there,...
>> I couldn't figure out why smarty makes my "nome_usu+LIKE+%27%25ab%25%27"
>> string passed trought an assign into a "name+LIKE+'%ab%'" string...
>> I'm using Smarty 2.6.0 stable release...
>>
>> I need the the string like the first way cause it will be passed in a
>> variable through GET method...
>> So it must become something like this:
>> myLink.php?condition=name+LIKE+%27%25ab%25%27 (I'm sure its really like this
>> since I use urlencode() on it before assigning to the template), but Smarty
>> always gives me:
>> myLink.php?condition=name+LIKE+'%ab%' and I can't have that so my GET
>> won't
>> work out...
>>
>> Any ideas to make Smarty output the way I need?
>>
>> Thank you...
>> Netto
>>
>> An test code should be:
>> $condition = "name like '%ab%'";
>> $tpl = new Smarty();
>> (...)
>> $tpl->assign('condition', urlencode($condition));
>> (...)