{"id":202058,"date":"2013-11-13T22:36:03","date_gmt":"2013-11-13T18:36:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=202058"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=202058","title":{"rendered":"<span class=\"post_title\">\u041d\u043e\u0432\u043e\u0435 \u0432 Symfony 2.4: \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 ExpressionLanguage<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       \u0412 Symfony 2.4 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u2014 <b>ExpressionLanguage<\/b>. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0438\u0436\u043a\u043e\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u00ab\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439\u00bb.<br \/>  \u042d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0442\u0432\u0438\u0433\u0430. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438\u043c.<br \/>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0442\u0432\u0438\u0433\u0430, ExpressionLanguage \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0434\u0432\u0443\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445:  <\/p>\n<ul>\n<li>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f: \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 PHP \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u043a\u043e\u0434 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f)<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435: \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/li>\n<\/ul>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 PHP \u043a\u043e\u0434, \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>.<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u044f\u0432\u043d\u044b\u043c \u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: <code>foo.bar<\/code> \u2014 \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, <code>foo['bar']<\/code> \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443, <code>foo.getBar()<\/code> \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<br \/>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e:  <\/p>\n<pre><code class=\"php\">use Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage;  $language = new ExpressionLanguage();  echo $language-&gt;evaluate('1 + 1'); \/\/ echo 2  echo $language-&gt;compile('1 + 2'); \/\/ echo &quot;(1 + 2)&quot; <\/code><\/pre>\n<p>  \u042f\u0437\u044b\u043a \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0442\u043e \u0436\u0435 \u0447\u0442\u043e \u0438 \u0442\u0432\u0438\u0433: \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0438\u0441\u043b\u0430, \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0445\u0435\u0448\u0438, \u0431\u0443\u043b\u0435\u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u2026 \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f PHP-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0434\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"php\">$language-&gt;evaluate('a.b', array('a' =&gt; new stdClass()));  $language-&gt;compile('a.b', array('a')); <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u043d\u043e \u043d\u0435 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u2014 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044f\u0437\u044b\u043a\u0430. \u041e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u0432 \u0442\u0432\u0438\u0433\u0435 (\u0434\u043b\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>register()<\/code>)<br \/>  \u041a\u0430\u043a \u043d\u0430 \u0441\u0447\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f? \u041c\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 Symfony.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 (Service Container)<\/h4>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440:  <\/p>\n<pre><code class=\"php\">$c-&gt;register('foo', 'Foo')-&gt;addArgument(new Expression('bar.getvalue()')); <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438: <code>service()<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u0438 <code>parameter<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:  <\/p>\n<pre><code>service(&quot;bar&quot;).getValue(parameter(&quot;value&quot;)) <\/code><\/pre>\n<p>  \u0412 XML:  <\/p>\n<pre><code class=\"xml\">&lt;service id=&quot;foo&quot; class=&quot;Foo&quot;&gt;     &lt;argument type=&quot;expression&quot;&gt;service('bar').getvalue(parameter('value'))&lt;\/argument&gt; &lt;\/service&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a PHP-\u0434\u0430\u043c\u043f\u0435\u0440 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 PHP \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"php\">$this-&gt;get(&quot;bar&quot;)-&gt;getvalue($this-&gt;getParameter(&quot;value&quot;)) <\/code><\/pre>\n<h4>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (Access Control Rules)<\/h4>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a <a href=\"http:\/\/symfony.com\/blog\/security-access-control-documentation-issue\">\u043d\u0435\u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/a><br \/>  \u041d\u043e\u0432\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code> allow_if <\/code> \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:  <\/p>\n<pre><code>access_control:     - { path: ^\/_internal\/secure, allow_if: &quot;'127.0.0.1' == request.getClientIp() or has_role('ROLE_ADMIN')&quot; } <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441<code> \/_internal\/secure<\/code> \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0437\u0430\u0448\u0435\u0434\u0448\u0438\u0445 \u043d\u0435 \u0441 <code>localhost<\/code> \u0438\u043b\u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043f\u0440\u0430\u0432\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.<br \/>  <code>request<\/code>, <code>token<\/code> \u0438 <code>user<\/code> \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, <code>is_anonymous()<\/code>, <code>is_authenticated()<\/code>, <code>is_fully_authenticated()<\/code>, <code>is_rememberme()<\/code>, <code>and has_role() <\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<h4>Twig<\/h4>\n<p>  \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0432\u0430\u0448\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>expression<\/code>  <\/p>\n<pre><code class=\"markdown\">{% if is_granted(expression('has_role(&quot;FOO&quot;)')) %}    ... {% endif %} <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <b>SensioFrameworkExtraBundle<\/b>, \u0443 \u0432\u0430\u0441 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b, \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@ Security<\/code>  <\/p>\n<pre><code class=\"php\">\/**  * @Route(&quot;\/post\/{id}&quot;)  * @Security(&quot;has_role('ROLE_ADMIN')&quot;)  *\/ public function showAction(Post $post) { } <\/code><\/pre>\n<p>  <i><b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>: \u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@ Security<\/code> \u0431\u0443\u0434\u0435\u0442 \u0447\u0430\u0441\u0442\u044c\u044e 3 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0430\u043d\u0434\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0439\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 Symfony 2.4<\/i><\/p>\n<h4>\u041a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 <b>SensioFrameworkExtraBundle<\/b> \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@Cache<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a HTTP \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445:  <\/p>\n<pre><code class=\"php\">\/**  * @Route(&quot;\/post\/{id}&quot;)  * @Cache(smaxage=&quot;15&quot;)  *\/ public function showAction(Request $request, Post $post) {     $response = new Response();     $response-&gt;setLastModified($post-&gt;getUpdated());     if ($response-&gt;isNotModified($request)) {         return $response;     }      \/\/ ... } <\/code><\/pre>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0441\u0435 \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 (\u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f ETag):  <\/p>\n<pre><code class=\"php\">\/**  * @Route(&quot;\/post\/{id}&quot;)  * @Cache(smaxage=&quot;15&quot;, lastModified=&quot;post.getUpdatedAt()&quot;)  *\/ public function showAction(Post $post) {     \/\/ ... } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f (Routing)<\/h4>\n<p>  \u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 Symfony \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0440\u043e\u0443\u0442 \u043f\u043e \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c (\u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a <code>info<\/code>, <code>method<\/code>, <code>sheme<\/code>), \u043d\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u0431\u0430\u0437\u0438\u0440\u0443\u044e\u0449\u0430\u044f\u0441\u044f \u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043e\u0431\u044a\u0435\u043a\u0442 <code>Request<\/code>)<br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0440\u0438\u043a\u0442\u0438\u0432\u0443 <code>condition<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <code>request<\/code> \u0438 routing <code>context<\/code>:  <\/p>\n<pre><code class=\"php\">hello:     path: \/hello\/{name}     condition: &quot;context.getMethod() in ['GET', 'HEAD'] and request.headers.get('User-Agent') =~ '\/firefox\/i'&quot; <\/code><\/pre>\n<p>  \u0418 \u043e\u043f\u044f\u0442\u044c \u0442\u0430\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f PHP \u0434\u0430\u043c\u043f\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (URL matcher), \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 PHP \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"php\">\/\/ hello if (0 === strpos($pathinfo, '\/hello') && preg_match('#^\/hello\/(?P&lt;name&gt;[^\/]++)$#s', $pathinfo, $matches)     && (in_array($context-&gt;getMethod(), array(0 =&gt; &quot;GET&quot;, 1 =&gt; &quot;HEAD&quot;))     && preg_match(&quot;\/firefox\/i&quot;, $request-&gt;headers-&gt;get(&quot;User-Agent&quot;))) ) {     return $this-&gt;mergeDefaults(array_replace($matches, array('_route' =&gt; 'hello')), array ()); } <\/code><\/pre>\n<p>  <b>\u0418\u043c\u0435\u0439\u0442\u0435 \u0432\u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u044d\u0442\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0438\u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 URL<\/b>  <\/p>\n<h4>Validation<\/h4>\n<p>  \u041d\u043e\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <code>Expression<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"php\">use Symfony\\Component\\Validator\\Constraints as Assert;  \/**  * @Assert\\Expression(&quot;this.getFoo() == 'fo'&quot;, message=&quot;Not good!&quot;)  *\/ class Obj {     public function getFoo()     {         return 'foo';     } } <\/code><\/pre>\n<p>  \u0412 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430 <code>this<\/code> \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438.  <\/p>\n<h4>\u0414\u0432\u0438\u0436\u043e\u043a \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b (Business Rule Engine)<\/h4>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u044f\u0437\u044b\u043a \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0432\u0438\u0436\u043a\u0430 \u0431\u0438\u0437\u043d\u0435\u0441\u0441-\u043f\u0440\u0430\u0432\u0438\u043b. \u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0435\u0431\u043c\u0430\u0441\u0442\u0435\u0440 (\u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440) \u0441\u0430\u0439\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0430\u0439\u0442, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f PHP \u0438 \u0431\u0435\u0437 \u043f\u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0435\u0431\u044f \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"markdown\"># Get the special price if user.getGroup() in ['good_customers', 'collaborator']  # Promote article to the homepage when article.commentCount &gt; 100 and article.category not in [&quot;misc&quot;]  # Send an alert when product.stock &lt; 15 <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u043e\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Symfony 2.4. \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u0435\u0434-\u0440\u0435\u043b\u0438\u0437\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f (release candidate).<\/p>\n<p>  <i>\u0427\u0443\u0432\u0441\u0442\u0432\u0443\u044e \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u0433\u043b\u044f\u043d\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PHP, \u043d\u043e \u043f\u0440\u043e\u0448\u0443 \u0443\u0447\u0435\u0441\u0442\u044c \u0447\u0442\u043e \u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a, \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438 \u043f\u043e\u043a\u0430 \u0441\u0430\u043c \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u043d \u043c\u043d\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u0440\u0430\u0437\u0438\u043b\u043e \u0437\u0430\u0447\u0435\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0432 \u0442\u0432\u0438\u0433).<br \/>  \u0412\u0441\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0432 \u043b\u0438\u0447\u043a\u0443<\/i>   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/202058\/\"> http:\/\/habrahabr.ru\/post\/202058\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       \u0412 Symfony 2.4 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u2014 <b>ExpressionLanguage<\/b>. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0438\u0436\u043a\u043e\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u00ab\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439\u00bb.<br \/>  \u042d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0442\u0432\u0438\u0433\u0430. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438\u043c.<br \/>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0442\u0432\u0438\u0433\u0430, ExpressionLanguage \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0434\u0432\u0443\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445:  <\/p>\n<ul>\n<li>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f: \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 PHP \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u043a\u043e\u0434 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f)<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435: \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/li>\n<\/ul>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 PHP \u043a\u043e\u0434, \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>.<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u044f\u0432\u043d\u044b\u043c \u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: <code>foo.bar<\/code> \u2014 \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, <code>foo['bar']<\/code> \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443, <code>foo.getBar()<\/code> \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<br \/>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e:  <\/p>\n<pre><code class=\"php\">use Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage;  $language = new ExpressionLanguage();  echo $language-&gt;evaluate('1 + 1'); \/\/ echo 2  echo $language-&gt;compile('1 + 2'); \/\/ echo &quot;(1 + 2)&quot; <\/code><\/pre>\n<p>  \u042f\u0437\u044b\u043a \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0442\u043e \u0436\u0435 \u0447\u0442\u043e \u0438 \u0442\u0432\u0438\u0433: \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0438\u0441\u043b\u0430, \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0445\u0435\u0448\u0438, \u0431\u0443\u043b\u0435\u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u2026 \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f PHP-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0434\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"php\">$language-&gt;evaluate('a.b', array('a' =&gt; new stdClass()));  $language-&gt;compile('a.b', array('a')); <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u043d\u043e \u043d\u0435 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u2014 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044f\u0437\u044b\u043a\u0430. \u041e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u0432 \u0442\u0432\u0438\u0433\u0435 (\u0434\u043b\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>register()<\/code>)<br \/>  \u041a\u0430\u043a \u043d\u0430 \u0441\u0447\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f? \u041c\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 Symfony.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-202058","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202058","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202058"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202058\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}