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

ne rabotaet {if} {strip} {/if}

 
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 -> Language: Russian
View previous topic :: View next topic  
Author Message
sfinks
Smarty n00b


Joined: 30 Jul 2010
Posts: 1

PostPosted: Fri Jul 30, 2010 6:59 am    Post subject: ne rabotaet {if} {strip} {/if} Reply with quote

Хочу сделать удаление лишних символов по условию, пишу так:
Code:

{if $debug_mode eq 0}
  {strip}
{/if}


На что Smarty заявляет
Code:
syntax error: mismatched tag {/if}. expected {/strip}


Т.е. такая вложенность не допускается. Как-то можно это обойти?

--------------
Пока решил проблему направив вывод через {capture} в переменную и вывод её с модификатором strip.
Back to top
View user's profile Send private message
0r10n
Smarty n00b


Joined: 15 Jul 2011
Posts: 3

PostPosted: Fri Jul 15, 2011 6:54 am    Post subject: Reply with quote

В данном случае код написан не правильно!!! Strip это модификатор и он должен использоваться только рядом с переменной. http://www.smarty.net/docs/en/language.modifier.strip.tpl - на этой страничке в примере чётко написано применение данного модификатора.

В вашем же случае код должен выглядеть вроде этого

Code:

{if $debug_mode eq 0}
  {$var|strip}
{/if}


$var - переменная к которой применяется данный модификатор.
Back to top
View user's profile Send private message
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 -> Language: Russian 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