File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
components/expression_language Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,21 @@ register.
9090 }
9191 }
9292
93+ .. tip ::
94+
95+ To create an expression function from a PHP function with the
96+ :method: `Symfony\\ Component\\ ExpressionLanguage\\ ExpressionFunction::fromPhp ` static method::
97+
98+ ExpressionFunction::fromPhp('strtoupper');
99+
100+ Namespaced functions are supported, but they require a second argument to
101+ define the name of the expression::
102+
103+ ExpressionFunction::fromPhp('My\strtoupper', 'my_strtoupper');
104+
105+ .. versionadded :: 3.3
106+ The ``ExpressionFunction::fromPhp() `` method was introduced in Symfony 3.3.
107+
93108You can register providers using
94109:method: `Symfony\\ Component\\ ExpressionLanguage\\ ExpressionLanguage::registerProvider `
95110or by using the second argument of the constructor::
You can’t perform that action at this time.
0 commit comments