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

Commit0725a8b

Browse files
committed
Added docs for using functions
1 parente506f01 commit0725a8b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎components/expression_language/syntax.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ #"diff-7c1d01740af652e83a4feff0be6d870005f9641c2eb108854514f456c2e9d0ca-81-81-0" data-selected="false" role="gridcell" tabindex="-1" valign="top">81
81

8282
This will print ``Hi Hi Hi!``.
8383

84+
.. _component-expression-functions:
85+
86+
Working with Functions
87+
----------------------
88+
89+
You can also use registered functions in the expression by using the same
90+
syntax as PHP and JavaScript. The ExpressionLanguage component comes with one
91+
function by default: ``constant()`` Which will return the value of the PHP
92+
constant::
93+
94+
define('DB_USER', 'root');
95+
96+
echo $language->evaluate(
97+
'constant("DB_USER")'
98+
);
99+
100+
This will print ``root``.
101+
84102
.. _component-expression-arrays:
85103

86104
Working with Arrays

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp