You are here: Re: [SMARTY] Escaping { in assign statement (not using {literal}) « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Escaping { in assign statement (not using {literal})

Posted by Monte Ohrt on 08/10/05 19:53

Or:

{capture assign="somevar"}this: {ldelim}{rdelim} is a tag{/capture}

Or:

$smarty->assign('somevar','this: {} is a tag');

Or:

my.conf:
tagtext = this: {} is a tag

{config_load file="my.conf"}
{$smarty.config.tagtext}



boots wrote:

>That's tricky because you can not embed '{' and '}' (specifically '}')
>anywhere in a smarty tag so you can't use {ldelim} or {rdelim}... but
>you can use $smarty.ldelim and $smarty.rdelim.
>
>{assign var="somevar" value="this: `$smarty.ldelim``$smarty.rdelim` is
>a tag"}
>
>HTH
>
>--- Ivo Jansch <ivo@ibuildings.nl> wrote:
>
>
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>Hi,
>>
>>how can I make this work:
>>
>>{assign var="somevar" value="this: {} is a tag"}
>>
>>I need to escape the {} somehow, so it doesn't break the assign tag.
>>
>>Greetings,
>>Ivo
>>
>>- --
>>Ivo Jansch <ivo@ibuildings.nl>
>>ibuildings.nl BV - information technology
>>http://www.ibuildings.nl
>>-----BEGIN PGP SIGNATURE-----
>>Version: GnuPG v1.2.4 (MingW32)
>>Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>>
>>iD8DBQFC+hHY95NUnGFZm9cRAsdUAJ91VIOWOIgcu7pF++SUD7BQSerxbQCfYdlz
>>iyhYbgIpA9id2vWzQl5sU7Q=
>>=0+dH
>>-----END PGP SIGNATURE-----
>>
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация