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

Commit667d590

Browse files
committed
[symfony#3241] Minor tweaks to new expression language functions
1 parent240df84 commit667d590

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

‎components/expression_language/extending.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ Extending the ExpressionLanguage
55
================================
66

77
The ExpressionLanguage can be extended by adding custom functions. For
8-
instance, in theframework, the security has custom functions to check the
9-
user's role.
8+
instance, in theSymfony Framework, the security has custom functions to check
9+
theuser's role.
1010

1111
..note::
1212

1313
If you want to learn how to use functions in an expression, read
1414
":ref:`component-expression-functions`".
1515

16-
Register Functions
17-
------------------
16+
Registering Functions
17+
---------------------
1818

19-
Functionswill beregistered onthe current ``ExpressionLanguage`` instance.
19+
Functionsareregistered oneach specific ``ExpressionLanguage`` instance.
2020
That means the functions can be used in any expression executed by that
2121
instance.
2222

@@ -52,13 +52,12 @@ This method has 3 arguments:
5252
5353
This will print ``hello``.
5454

55-
Creating a new ExpressionLanguageclass
55+
Creating a new ExpressionLanguageClass
5656
---------------------------------------
5757

5858
When you use the ``ExpressionLanguage`` class in your library, it's recommend
5959
to create a new ``ExpressionLanguage`` class and register the functions there.
60-
The class will execute ``registerFunctions`` to register the default
61-
functions, you can override this to also add your own functions::
60+
Override ``registerFunctions`` to add your own functions::
6261

6362
namespace Acme\AwesomeLib\ExpressionLanguage;
6463

‎components/expression_language/syntax.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Working with Functions
8888

8989
You can also use registered functions in the expression by using the same
9090
syntax as PHP and JavaScript. The ExpressionLanguage component comes with one
91-
function by default: ``constant()`` Which will return the value of the PHP
91+
function by default: ``constant()``, which will return the value of the PHP
9292
constant::
9393

9494
define('DB_USER', 'root');
@@ -101,7 +101,7 @@ This will print ``root``.
101101

102102
..tip::
103103

104-
To read how to register your ownfunction to use in an expression, see
104+
To read how to register your ownfunctions to use in an expression, see
105105
":doc:`/components/expression_language/extending`".
106106

107107
.. _component-expression-arrays:
@@ -285,7 +285,7 @@ For example::
285285
);
286286

287287
This will evaluate to ``true``, because ``user.age`` is in the range from
288-
``18``till ``45``
288+
``18``to ``45``.
289289

290290
Ternary Operators
291291
~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp