Skip to content

Commit

Permalink
New feature #13732: Twig - add "striptags" allowed filters
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jun 4, 2018
1 parent c602558 commit fc48346
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/config/internal.php
Expand Up @@ -287,7 +287,8 @@
'last',
'capitalize',
'lower',
'upper'
'upper',
'strip_tags',
),
'methods' => array(
'ETwigViewRendererStaticClassProxy' => array("encode", "textfield", "form", "link", "emailField", "beginForm", "endForm", "dropDownList", "htmlButton", "passwordfield", "hiddenfield", "textArea", "checkBox"),
Expand Down Expand Up @@ -348,6 +349,7 @@
'createUrl',
'json_decode',
'json_encode',
'strip_tags',
/* Not in twigRenderer[functions] */
'include',
'dump',
Expand Down

3 comments on commit fc48346

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function here, for filters it's striptags, no ?

I never know if it's best to use filter or function :((((((

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter is a function with only one parameter
strip_tags(var);
{{ var | striptags }}

it's pretty the same indeed. But I could add the striptags filters, since it's Twig native.
I didn't notice it.

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i don't know what it's best … filter or function. Since i use more PHP : i use more function. Maybe «html dev» (intégrateur html in french) use more filter

Please sign in to comment.