{"id":323965,"date":"2021-05-29T09:00:10","date_gmt":"2021-05-29T09:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=323965"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=323965","title":{"rendered":"\u041d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u043c PHP \u0437\u0430 35 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430?"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/641\/23c\/cad\/64123ccad287c7e5e9476a7054c7cb8a.png\" width=\"774\" height=\"443\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043f\u0430\u043b \u043c\u043d\u0435 \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u0434 \u0440\u0443\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 WordPress (WP), \u0433\u0434\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u0442\u0435\u043c\u0443. \u0412 WP \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, &#8212; \u043d\u0435 \u043d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a. \u041d\u043e \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043a\u0430\u043a \u0432 <a href=\"https:\/\/twig.symfony.com\/\" rel=\"noopener noreferrer nofollow\">Twig<\/a>, \u0430 PHP \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0442\u0430\u043a \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/arshaw.com\/phpti\/\" rel=\"noopener noreferrer nofollow\">phpti<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043f\u0430\u0440\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u201cEvery Block is Always Executed!\u201c, \u0442. \u0435. \u0432\u0441\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b, \u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 &#8212; \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u0442\u0435\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0447\u0442\u043e, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0447\u0438\u0442\u0435\u0440\u0441\u0442\u0432\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 &#8212; \u0445\u043e\u0447\u0443 \u0435\u0449\u0451 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>ob_start<\/code> \u043d\u0430 \u0447\u0451\u043c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u043f\u0438\u0447\u0435\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 phpti \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438  <code>startblock\/endblock<\/code> \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>import<\/code> \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"php\">\/\/ layout.php &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt; &lt;?php startblock('blockName') ?&gt; &lt;?php endblock() ?&gt; &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt;<\/code><\/pre>\n<pre><code class=\"php\">\/\/ index.php &lt;?php include 'layout.php' ?&gt; &lt;!-- \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d --&gt; &lt;?php startblock('blockName') ?&gt;     &lt;!-- \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u043b\u043e\u043a\u0430 --&gt; &lt;?php endblock() ?&gt;<\/code><\/pre>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0412\u044b\u0437\u043e\u0432\u044b \u0432\u0440\u043e\u0434\u0435 start\/end \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u042d\u0442\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0430\u0440\u0442\u044b \u0438 \u044d\u043d\u0434\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u043b\u0435\u043d\u0438\u0432\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0440\u0445\u0443 \u0444\u0430\u0439\u043b\u0430. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0446\u0435?<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u0431\u043b\u043e\u043a\u043e\u0432: \u043e\u0434\u043d\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043a\u0443\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u044f\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u043c\u0435\u0441\u0442\u0443, \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e \u043c\u0435\u0441\u0442\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u044f\u0442, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e, \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e:<\/p>\n<pre><code class=\"php\">\/\/ layout.php &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt; &lt;?php slot('blockName', function(){ ?&gt; &lt;?php }) ?&gt; &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt;<\/code><\/pre>\n<pre><code class=\"php\">\/\/ index.php &lt;?php block('blockName', function(){ ?&gt;     &lt;!-- \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u043b\u043e\u043a\u0430 --&gt; &lt;?php }) ?&gt; &lt;?php include 'layout.php' ?&gt; &lt;!-- \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d --&gt;<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0431\u043b\u043e\u043a\u0438 \u043d\u0430 <code>slot<\/code> \u0438 <code>block<\/code>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u043b\u043e\u043a.<\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u043e \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u043a\u0440\u043e\u0435\u0442 \u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u0441\u0435 \u0445\u043e\u0442\u0435\u043b\u043a\u0438.<\/p>\n<p><code>root.php<\/code> &#8212; \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d, \u0432\u043d\u0438\u0437\u0443 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438:<\/p>\n<pre><code class=\"php\">&lt;!DOCTYPE html&gt; &lt;html&gt;   &lt;head&gt;     &lt;title&gt;&lt;?php slot('title') \/* \u0441\u043b\u043e\u0442 - \u043c\u0435\u0441\u0442\u043e \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 *\/ ?&gt;&lt;\/title&gt;   &lt;\/head&gt;   &lt;body&gt;     &lt;div id=\"root\"&gt;       &lt;?php slot('body', function () { \/* \u0441\u043b\u043e\u0442 \u0441 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 *\/?&gt;          &lt;p&gt;'body' :: root.php&lt;\/p&gt;        &lt;?php }) ?&gt;     &lt;\/div&gt;   &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p><code>two-columns.php<\/code> &#8212; \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:<\/p>\n<pre><code class=\"php\">&lt;?php  block('title', function () { \/* \u0431\u043b\u043e\u043a - \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u0441\u043b\u043e\u0442 *\/?&gt;   Title :: two-columns.php &lt;?php }); block('body', function () { ?&gt;   &lt;div id=\"two-columnts\"&gt;     &lt;div id=\"main\"&gt;       &lt;?php slot('main', function () { \/* \u0441\u043b\u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 *\/?&gt;     &lt;p&gt;'main' :: two-columns.php&lt;\/p&gt;   &lt;?php }) ?&gt; &lt;\/div&gt; &lt;div id=\"side\"&gt;   &lt;?php slot('side', function () { ?&gt; &lt;p&gt;'side' :: two-columns.php&lt;\/p&gt;    &lt;?php }) ?&gt; &lt;\/div&gt;   &lt;\/div&gt;   &lt;div id=\"footer\"&gt;     &lt;?php slot('footer', function () { ?&gt;   &lt;p&gt;'footer' :: two-columns.php&lt;\/p&gt; &lt;?php }) ?&gt;   &lt;\/div&gt; &lt;?php }); include '.\/root.php'; \/\/ \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043e\u0442 root.php<\/code><\/pre>\n<p><code>index.php<\/code> &#8212; \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u0430\u0439\u0442\u0430, \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:<\/p>\n<pre><code class=\"php\">&lt;?php require_once '..\/src\/InheritTpl.php';  block('title', function () { ?&gt; 'title' :: index.php &lt;?php }); block('side', function () { ?&gt;   &lt;p&gt;'side' :: index.php&lt;\/p&gt; &lt;?php });  block('main', function () { ?&gt;   &lt;div id=\"main-index\"&gt; &lt;!-- \u041e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f --&gt;     &lt;?php super() \/* \u0442\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 *\/?&gt;   &lt;\/div&gt; &lt;?php }); block('main', function () { \/* \u0415\u0449\u0451 \u0440\u0430\u0437 \u0442\u043e\u0442 \u0436\u0435 \u0431\u043b\u043e\u043a, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435\u0442? *\/?&gt;   &lt;div id=\"main-index\"&gt; &lt;!-- \u0418 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     &lt;?php super() ?&gt;   &lt;\/div&gt; &lt;?php }); \/\/ \u0410 'footer' \u043f\u0443\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043a\u0430\u043a \u0431\u044b\u043b include '.\/two-columns.php'; <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442  \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 (\u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438):<\/p>\n<pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt;   &lt;head&gt;     &lt;title&gt; 'title' :: index.php &lt;\/title&gt;   &lt;\/head&gt;   &lt;body&gt;     &lt;div id=\"root\"&gt;       &lt;div id=\"two-columnts\"&gt;         &lt;div id=\"main\"&gt;           &lt;div id=\"main-index\"&gt; &lt;!-- \u041e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f --&gt;             &lt;div id=\"main-index\"&gt; &lt;!-- \u0418 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;               &lt;p&gt;'main' :: two-columns.php&lt;\/p&gt;             &lt;\/div&gt;           &lt;\/div&gt;         &lt;\/div&gt;         &lt;div id=\"side\"&gt;           &lt;p&gt;'side' :: index.php&lt;\/p&gt;         &lt;\/div&gt;       &lt;\/div&gt;       &lt;div id=\"footer\"&gt;         &lt;p&gt;'footer' :: two-columns.php&lt;\/p&gt;       &lt;\/div&gt;     &lt;\/div&gt;   &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>\u0425\u043e\u0442\u0435\u043b\u043a\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u044b. \u041d\u043e \u0432\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0443 \u0448\u0442\u0443\u043a\u0443 \u0431\u044b\u0441\u0442\u0440\u0435\u0435?<\/p>\n<p>\u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435 \u043f\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 phpti. \u0414\u0430\u0434\u0438\u043c \u0435\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0444\u043e\u0440\u0443, \u0442.\u043a. \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0442 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432.<\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0432\u0440\u0435\u043c\u044f 10,000 \u0440\u0435\u043d\u0434\u0435\u0440\u043e\u0432 \u043d\u0430 PHP 8.0.2 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 3.6\u0413\u0413\u0446.<\/p>\n<ul>\n<li>\n<p>phpti:  0.831 \u0441\u0435\u043a\u0443\u043d\u0434<\/p>\n<\/li>\n<li>\n<p>\u0441\u0430\u0431\u0436: 0.353 \u0441\u0435\u043a\u0443\u043d\u0434<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432 10 \u0440\u0430\u0437, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0432 2 \u0440\u0430\u0437\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/idashevskii\/native-tpl-heir\/blob\/main\/src\/NativeTplHeir.php\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<\/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=\"https:\/\/habr.com\/ru\/post\/559896\/\"> https:\/\/habr.com\/ru\/post\/559896\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043f\u0430\u043b \u043c\u043d\u0435 \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u0434 \u0440\u0443\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 WordPress (WP), \u0433\u0434\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u0442\u0435\u043c\u0443. \u0412 WP \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, &#8212; \u043d\u0435 \u043d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a. \u041d\u043e \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043a\u0430\u043a \u0432 <a href=\"https:\/\/twig.symfony.com\/\" rel=\"noopener noreferrer nofollow\">Twig<\/a>, \u0430 PHP \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0442\u0430\u043a \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/arshaw.com\/phpti\/\" rel=\"noopener noreferrer nofollow\">phpti<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043f\u0430\u0440\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u201cEvery Block is Always Executed!\u201c, \u0442. \u0435. \u0432\u0441\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b, \u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 &#8212; \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u0442\u0435\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0447\u0442\u043e, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0447\u0438\u0442\u0435\u0440\u0441\u0442\u0432\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 &#8212; \u0445\u043e\u0447\u0443 \u0435\u0449\u0451 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>ob_start<\/code> \u043d\u0430 \u0447\u0451\u043c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u043f\u0438\u0447\u0435\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 phpti \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438  <code>startblock\/endblock<\/code> \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>import<\/code> \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"php\">\/\/ layout.php &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt; &lt;?php startblock('blockName') ?&gt; &lt;?php endblock() ?&gt; &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt;<\/code><\/pre>\n<pre><code class=\"php\">\/\/ index.php &lt;?php include 'layout.php' ?&gt; &lt;!-- \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d --&gt; &lt;?php startblock('blockName') ?&gt;     &lt;!-- \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u043b\u043e\u043a\u0430 --&gt; &lt;?php endblock() ?&gt;<\/code><\/pre>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0412\u044b\u0437\u043e\u0432\u044b \u0432\u0440\u043e\u0434\u0435 start\/end \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u042d\u0442\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0430\u0440\u0442\u044b \u0438 \u044d\u043d\u0434\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u043b\u0435\u043d\u0438\u0432\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0440\u0445\u0443 \u0444\u0430\u0439\u043b\u0430. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0446\u0435?<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u0431\u043b\u043e\u043a\u043e\u0432: \u043e\u0434\u043d\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043a\u0443\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u044f\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u043c\u0435\u0441\u0442\u0443, \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e \u043c\u0435\u0441\u0442\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u044f\u0442, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e, \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e:<\/p>\n<pre><code class=\"php\">\/\/ layout.php &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt; &lt;?php slot('blockName', function(){ ?&gt; &lt;?php }) ?&gt; &lt;!-- \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 --&gt;<\/code><\/pre>\n<pre><code class=\"php\">\/\/ index.php &lt;?php block('blockName', function(){ ?&gt;     &lt;!-- \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u043b\u043e\u043a\u0430 --&gt; &lt;?php }) ?&gt; &lt;?php include 'layout.php' ?&gt; &lt;!-- \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d --&gt;<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0431\u043b\u043e\u043a\u0438 \u043d\u0430 <code>slot<\/code> \u0438 <code>block<\/code>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u043b\u043e\u043a.<\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u043e \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u043a\u0440\u043e\u0435\u0442 \u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u0441\u0435 \u0445\u043e\u0442\u0435\u043b\u043a\u0438.<\/p>\n<p><code>root.php<\/code> &#8212; \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d, \u0432\u043d\u0438\u0437\u0443 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438:<\/p>\n<pre><code class=\"php\">&lt;!DOCTYPE html&gt; &lt;html&gt;   &lt;head&gt;     &lt;title&gt;&lt;?php slot('title') \/* \u0441\u043b\u043e\u0442 - \u043c\u0435\u0441\u0442\u043e \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 *\/ ?&gt;&lt;\/title&gt;   &lt;\/head&gt;   &lt;body&gt;     &lt;div id=\"root\"&gt;       &lt;?php slot('body', function () { \/* \u0441\u043b\u043e\u0442 \u0441 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 *\/?&gt;          &lt;p&gt;'body' :: root.php&lt;\/p&gt;        &lt;?php }) ?&gt;     &lt;\/div&gt;   &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p><code>two-columns.php<\/code> &#8212; \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:<\/p>\n<pre><code class=\"php\">&lt;?php  block('title', function () { \/* \u0431\u043b\u043e\u043a - \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u0441\u043b\u043e\u0442 *\/?&gt;   Title :: two-columns.php &lt;?php }); block('body', function () { ?&gt;   &lt;div id=\"two-columnts\"&gt;     &lt;div id=\"main\"&gt;       &lt;?php slot('main', function () { \/* \u0441\u043b\u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 *\/?&gt;     &lt;p&gt;'main' :: two-columns.php&lt;\/p&gt;   &lt;?php }) ?&gt; &lt;\/div&gt; &lt;div id=\"side\"&gt;   &lt;?php slot('side', function () { ?&gt; &lt;p&gt;'side' :: two-columns.php&lt;\/p&gt;    &lt;?php }) ?&gt; &lt;\/div&gt;   &lt;\/div&gt;   &lt;div id=\"footer\"&gt;     &lt;?php slot('footer', function () { ?&gt;   &lt;p&gt;'footer' :: two-columns.php&lt;\/p&gt; &lt;?php }) ?&gt;   &lt;\/div&gt; &lt;?php }); include '.\/root.php'; \/\/ \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043e\u0442 root.php<\/code><\/pre>\n<p><code>index.php<\/code> &#8212; \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u0430\u0439\u0442\u0430, \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:<\/p>\n<pre><code class=\"php\">&lt;?php require_once '..\/src\/InheritTpl.php';  block('title', function () { ?&gt; 'title' :: index.php &lt;?php }); block('side', function () { ?&gt;   &lt;p&gt;'side' :: index.php&lt;\/p&gt; &lt;?php });  block('main', function () { ?&gt;   &lt;div id=\"main-index\"&gt; &lt;!-- \u041e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f --&gt;     &lt;?php super() \/* \u0442\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 *\/?&gt;   &lt;\/div&gt; &lt;?php }); block('main', function () { \/* \u0415\u0449\u0451 \u0440\u0430\u0437 \u0442\u043e\u0442 \u0436\u0435 \u0431\u043b\u043e\u043a, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435\u0442? *\/?&gt;   &lt;div id=\"main-index\"&gt; &lt;!-- \u0418 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     &lt;?php super() ?&gt;   &lt;\/div&gt; &lt;?php }); \/\/ \u0410 'footer' \u043f\u0443\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043a\u0430\u043a \u0431\u044b\u043b include '.\/two-columns.php'; <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442  \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 (\u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438):<\/p>\n<pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt;   &lt;head&gt;     &lt;title&gt; 'title' :: index.php &lt;\/title&gt;   &lt;\/head&gt;   &lt;body&gt;     &lt;div id=\"root\"&gt;       &lt;div id=\"two-columnts\"&gt;         &lt;div id=\"main\"&gt;           &lt;div id=\"main-index\"&gt; &lt;!-- \u041e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f --&gt;             &lt;div id=\"main-index\"&gt; &lt;!-- \u0418 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043e\u0431\u0435\u0440\u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;               &lt;p&gt;'main' :: two-columns.php&lt;\/p&gt;             &lt;\/div&gt;           &lt;\/div&gt;         &lt;\/div&gt;         &lt;div id=\"side\"&gt;           &lt;p&gt;'side' :: index.php&lt;\/p&gt;         &lt;\/div&gt;       &lt;\/div&gt;       &lt;div id=\"footer\"&gt;         &lt;p&gt;'footer' :: two-columns.php&lt;\/p&gt;       &lt;\/div&gt;     &lt;\/div&gt;   &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>\u0425\u043e\u0442\u0435\u043b\u043a\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u044b. \u041d\u043e \u0432\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0443 \u0448\u0442\u0443\u043a\u0443 \u0431\u044b\u0441\u0442\u0440\u0435\u0435?<\/p>\n<p>\u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435 \u043f\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 phpti. \u0414\u0430\u0434\u0438\u043c \u0435\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0444\u043e\u0440\u0443, \u0442.\u043a. \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0442 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432.<\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0432\u0440\u0435\u043c\u044f 10,000 \u0440\u0435\u043d\u0434\u0435\u0440\u043e\u0432 \u043d\u0430 PHP 8.0.2 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 3.6\u0413\u0413\u0446.<\/p>\n<ul>\n<li>\n<p>phpti:  0.831 \u0441\u0435\u043a\u0443\u043d\u0434<\/p>\n<\/li>\n<li>\n<p>\u0441\u0430\u0431\u0436: 0.353 \u0441\u0435\u043a\u0443\u043d\u0434<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432 10 \u0440\u0430\u0437, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0432 2 \u0440\u0430\u0437\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/idashevskii\/native-tpl-heir\/blob\/main\/src\/NativeTplHeir.php\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<\/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=\"https:\/\/habr.com\/ru\/post\/559896\/\"> https:\/\/habr.com\/ru\/post\/559896\/<\/a><br \/><\/br><\/br><\/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-323965","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323965","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=323965"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323965\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}