Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6d9af37

Browse files
committed
Add fromPhp tip
1 parent89cba1e commit6d9af37

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎components/expression_language/extending.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ register.
9090
}
9191
}
9292
93+
..tip::
94+
95+
You can create an expression expression from a PHP function with the
96+
:method:`Symfony\\Component\\ExpressionLanguage\\ExpressionFunction::fromPhp` static method::
97+
98+
ExpressionFunction::fromPhp('strtoupper');
99+
100+
It allows namespaced PHP function where second parameter must be set to name expression::
101+
102+
ExpressionFunction::fromPhp('My\strtoupper', 'my_strtoupper');
103+
93104
You can register providers using
94105
:method:`Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage::registerProvider`
95106
or by using the second argument of the constructor::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp