Add strip_tags exceptions in smarty -


I am trying to add strip_tags exception for smarty am, but for some reason it is not working down my address Is anyone helping me to understand what I am doing.

  & lt; Td class = "olotd4 tooltip2" & gt; & Lt; Period & gt; {$ Customer_work_orders_result [i] .WORK_ORDER_DESCRIPTION | Strip_tags: " gt; & lt; dell & gt; & lt; them & gt; & lt; strong & gt; & lt; blockquote & gt; | Stripslashes} & lt; / Span & gt; {$ Customer_work_orders_result [i] .WORK_ORDER_SCOPE} & lt; / TD & gt;  

It is working but is extracting everything.

Thanks in advance ..

Smartli is Strip_tags implementation does not allow it, however, you can write your own modifiers are:

(or your custom plugins folder) as smart / plugins / modifier.strip_tags_exclude.php save it

  function smarty_modifier_strip_tags_exclude () {$ Params = func_get_args (); If (! Asset ($ paragraph [1])) {$ params [1] = true; } If ($ parameters [1] === true) {return preg_replace ( '& lt ;! [^ & Gt;]? * & Gt;!', '', $ Parameters [0]); } Else {if (is_string ($ parameter [1])) {$ allowable_tags = strtr ([$ parameters [1], ']', '& lt; & gt;'); } Return strip_tags ($ params [0], $ acceptable_tags); }}  

and then you can use it like this:

  $ variable | Strip_tags_exclude: '& lt; A & gt; & Lt; P & gt; & Lt; Ul & gt; & Lt; Li & gt; '}  

or alternatively (which is somewhat confusing editors find that you're opening tag):

  {$ variable | Strip_tags_exclude: '[a] [p] [ul] [li]'}  

Comments