{"id":254238,"date":"2015-04-01T03:08:11","date_gmt":"2015-03-31T23:08:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=254238"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=254238","title":{"rendered":"\u0412\u0441\u0435 \u0435\u0449\u0435 \u0442\u043e\u0440\u0442, \u0447\u0430\u0441\u0442\u044c 3.0.0"},"content":{"rendered":"<p>       \u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0432\u044b\u0448\u0435\u043b \u0432 \u0440\u0435\u043b\u0438\u0437 CakePHP 3.0.0.<\/p>\n<p>  \u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 cakephp, \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0431\u044d\u043a\u044d\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u043b\u0435\u0442 \u043c\u044b \u0434\u043e\u0441\u043a\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0432 \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u0445 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430\u0445. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0442 \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043d\u0430 3.0 \u043d\u0430\u043c\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u044b, \u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e cakephp \u0441\u043d\u043e\u0432\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 \u0441\u0435\u0431\u0435 \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/ad2\/29c\/dbf\/ad229cdbf55a4124872169ccca68aa24.jpg\"\/><br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432 CakePHP 3.0.0:  <\/p>\n<ul>\n<li>\u043d\u043e\u0432\u0430\u044f ORM<\/li>\n<li>\u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0438 \u0433\u0438\u0431\u043a\u0430\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/li>\n<li>\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f<\/li>\n<li>\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/li>\n<li>\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u043f\u0430\u043d\u0435\u043b\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438<\/li>\n<li>\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/li>\n<li>\u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/li>\n<li>View Cells<\/li>\n<\/ul>\n<p>  \u042f \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0438\u0433\u0440\u0430\u043b\u0441\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 3.0, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430.<\/p>\n<p>  \u041c\u0435\u043d\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e \u0442\u0443\u0442\u043e\u0440\u0443:<\/p>\n<p>  <a href=\"#Example1\">\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 CakePHP 3 \u2013 \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/a><br \/>  <a href=\"#Example2\">View Cells \u0432 CakePHP 3.0 \u2013 \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/a><br \/>  <a href=\"#Example3\">Events \u0432 CakePHP 3 \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432 4 \u0448\u0430\u0433\u0430<\/a><br \/>  <a href=\"#Example4\">\u0424\u043e\u0440\u043c\u044b Twitter bootstrap \u0432 CakePHP 3<\/a><br \/>  <a href=\"#Example5\">\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 CakePHP 3<\/a><br \/>  <a href=\"#Example6\">\u0422\u0435\u043c\u044b \u0432 CakePHP 3 \u2013 \u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<\/a><\/p>\n<p>  <a name=\"Example1\"><\/a>  <\/p>\n<h3>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 CakePHP 3 \u2013 \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/h3>\n<p>  \u0412 CakePHP 3 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u2013 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Phinx.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438. \u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u0434\u043e\u043c, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u00ab\u043b\u044e\u0431\u0438\u043c\u0447\u0438\u043a\u043e\u043c\u00bb \u0431\u044b\u043b\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 Git. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u043b\u043e \u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u043d\u043e\u0433\u0438\u0435 \u0431\u044b\u043b\u0438 \u043e\u0437\u0430\u0434\u0430\u0447\u0435\u043d\u044b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0447\u0443\u0434\u043e\u043c! \ud83d\ude42<\/p>\n<p>  <b>\u0428\u0430\u0433 1 \u2013 \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/b><\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 CakePHP \u0438 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b composer.json, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"php\">&quot;require&quot;: {     &quot;cakephp\/migrations&quot;: &quot;dev-master&quot; } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0444\u0430\u0439\u043b bootstrap.php \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"php\">Plugin::load('Migrations'); <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <b>\u0428\u0430\u0433 2 \u2013 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/b><\/p>\n<p>  \u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u0432\u0435\u0434\u0438\u0442\u0435<\/p>\n<p>  .\/bin\/cake migrations create CreatePostsTable<\/p>\n<p>  \u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435<\/p>\n<p>  using migration path \/home\/tariquesani\/WWW\/migration\/config\/Migrations<br \/>  created .\/config\/Migrations\/20141015052852_create_posts_table.php<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u0434\u043b\u044f \u0432\u0430\u0441 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u043a\u0435\u043b\u0435\u0442 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0435\u043c \u043b\u044e\u0431\u0438\u043c\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0434\u0430, \u0433\u0434\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0435  <\/p>\n<pre><code class=\"php\">&lt;?php  use Phinx\\Migration\\AbstractMigration;  class CreatePostsTable extends AbstractMigration {     \/**      * Change Method.      *      * More information on this method is available here:      * http:\/\/docs.phinx.org\/en\/latest\/migrations.html#the-change-method      *      * Uncomment this method if you would like to use it.      *     public function change()     {     }     *\/          \/**      * Migrate Up.      *\/     public function up()     {          }      \/**      * Migrate Down.      *\/     public function down()     {      } } <\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0435-\u0447\u0442\u043e \u0432 function up() \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b Posts. \u00abfunction up\u00bb \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044f \u043f\u0440\u043e\u0435\u043a\u0442, \u0430 \u00abfunction down()\u00bb \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0440\u0435\u0432\u0435\u0440\u0441\u0430 \u0438\u043b\u0438 \u043e\u0442\u043a\u0430\u0442\u0430 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \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 \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e Phinx change(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0432\u0435\u0440\u0441\u0438\u0432\u043d\u043e\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u00abup\u00bb \u0438 \u00abdown\u00bb. \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u044d\u0442\u0438 \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e \u0432\u0438\u0434\u0430  <\/p>\n<pre><code class=\"php\">   \/**      * Migrate Up.      *\/     public function up()     {         $posts = $this-&gt;table('posts');          $posts-&gt;create();       }      \/**      * Migrate Down.      *\/     public function down()     {          $this-&gt;dropTable('posts');      } <\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 3 \u2013 \u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/b><\/p>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 <\/p>\n<p>  .\/bin\/cake migrations migrate<\/p>\n<p>  \u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435<\/p>\n<p>  Welcome to CakePHP v3.0.0-beta2 Console<br \/>   \u2014 App: src<br \/>  Path: \/home\/tariquesani\/WWW\/migration\/src\/<br \/>   \u2014 using migration path \/home\/tariquesani\/WWW\/migration\/config\/Migrations<br \/>  using environment default<br \/>  using adapter mysql<br \/>  using database caketest<\/p>\n<p>  == 20141015052852 CreatePostsTable: migrating<br \/>   == 20141015052852 CreatePostsTable: migrated 0.2205s<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0442\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 Posts \u0441 \u0430\u0432\u0442\u043e\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u043d\u044b\u043c \u043f\u043e\u043b\u0435\u043c ID. \u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0441\u043e\u0437\u0434\u0430\u0432 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e.<\/p>\n<p>  <b>\u0428\u0430\u0433 3 \u2013 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/b><\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435<\/p>\n<p>  .\/bin\/cake migrations create AlterPostsTable<\/p>\n<p>  \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e Change \u043d\u043e\u0432\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0432\u043d\u0435\u0441\u044f \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0438\u0448\u0435\u043c \u0432 down().  <\/p>\n<pre><code class=\"php\">    public function change()     {              $posts = $this-&gt;table('posts');          $posts-&gt;addColumn('title', 'string')               -&gt;addColumn('body', 'text')               -&gt;addColumn('created', 'datetime')               -&gt;addColumn('modified', 'datetime')               -&gt;save();      } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0437\u0430\u043d\u043e\u0432\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u044b\u0448\u0435. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u044b Posts \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<p>  <b>\u0428\u0430\u0433 4 \u2013 \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u0442\u043a\u0430\u0442\u0430<\/b><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e Change, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435. <\/p>\n<p>  .\/bin\/cake migrations rollback<\/p>\n<p>  \u042d\u0442\u043e \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 AlterPostsTable. \u0417\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 <\/p>\n<p>  .\/bin\/cake migrations status<\/p>\n<p>  \u0442\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435<\/p>\n<p>  Status Migration ID Migration Name <br \/>   \u2014  up 20141015052852 CreatePostsTable<br \/>   down 20141015060152 AlterPostsTable<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0431\u044b\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u044b. \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u0442 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0435\u0440\u0435\u0436\u0435\u043d\u0438\u0435! \u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u043e\u0442\u043a\u0430\u0442, \u0435\u0441\u043b\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b. \u041d\u043e \u0432\u044b \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u0438 \u0442\u0430\u043a \u0437\u043d\u0430\u043b\u0438, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b SQL \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 (\u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Phinx). \u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u044b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0439. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u2013 \u044d\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 VCS \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438.<\/p>\n<p>  <a name=\"Example2\"><\/a>  <\/p>\n<h3>View Cells \u0432 CakePHP 3.0 \u2013 \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/h3>\n<p>  \u041a\u043e\u043d\u0446\u0435\u043f\u0442 View Cells \u0432 CakePHP 3 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e. \u041a\u043d\u0438\u0436\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 View Cells: \u043c\u0438\u043d\u0438-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u0412 2007 \u0433\u043e\u0434\u0443 \u043e \u043d\u0438\u0445 \u043f\u0438\u0441\u0430\u043b \u042d\u043d\u0434\u0438 \u0414\u043e\u0443\u0441\u043e\u043d. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f View Cells, \u044f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b: \u00abThink Widgets\u00bb \u2014 \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 WordPress, \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u043e \u0447\u0435\u043c \u044f. \u0412 CakePHP \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c requestAction(), \u043d\u043e \u044d\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u0432, \u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e. View Cells \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043d\u0435\u043e\u0441\u043f\u043e\u0440\u0438\u043c\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430: \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c View Cell \u0432 \u043d\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c CakePHP 3 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439. \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435 Title, \u043a\u0440\u043e\u043c\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 ID, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0436\u0435 \u043f\u043e\u043b\u044f \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044e.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0432\u0430\u043c \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442 \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c View Cells.<\/p>\n<p>  <b>\u0428\u0430\u0433 1<\/b><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u0441\u043d\u043e\u0432\u0430 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 View Cell, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<p>  cake bake cell Posts<\/p>\n<p>  \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0444\u0430\u0439\u043b\u044b src\/View\/Cell\/PostsCell.php \u0438 src\/Template\/Cell\/Posts\/display.ctp, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432. \u0424\u0430\u0439\u043b PostsCell.php \u2013 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0439 \u043c\u0438\u043d\u0438-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443, \u0430 \u0444\u0430\u0439\u043b display.ctp \u2013 \u0444\u0430\u0439\u043b \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 PostsCell. \u041e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>  <b>\u0428\u0430\u0433 2<\/b><\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b PostsCell.php \u0432 \u0441\u0432\u043e\u0435\u043c \u043b\u044e\u0431\u0438\u043c\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a  <\/p>\n<pre><code class=\"php\">&lt;?php namespace App\\View\\Cell;  use Cake\\View\\Cell;  \/**  * Posts cell  *\/ class PostsCell extends Cell {  \/**  * List of valid options that can be passed into this  * cell's constructor.  *  * @var array  *\/ \tprotected $_validCellOptions = [];  \/**  * Default display method.  *  * @return void  *\/ \tpublic function display() {             #add code  \t}  } <\/code><\/pre>\n<p>  \u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c.<br \/>  \u2022 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 App\\View\\Cell<br \/>  \u2022 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 Cell<br \/>  \u2022 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043e\u0442 Cake\\View\\Cell.<\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 display(). \u042d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0432\u0435\u0434\u0435\u043c \u0432 \u043c\u0435\u0442\u043e\u0434 display \u043a\u043e\u0434. \u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442 \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434  <\/p>\n<pre><code class=\"php\">\tpublic function display() { \t\t$this-&gt;loadModel('Posts');  \t\t$total_posts = $this-&gt;Posts-&gt;find()-&gt;count();  \t\t$recent_posts = $this-&gt;Posts-&gt;find() \t\t\t\t\t\t\t\t\t-&gt;select('title') \t\t\t\t\t\t\t\t\t-&gt;order(['created' =&gt; 'DESC']) \t\t\t\t\t\t\t\t\t-&gt;limit(3) \t\t\t\t\t\t\t\t\t-&gt;toArray();  \t\t$this-&gt;set(['total_posts' =&gt; $total_posts, 'recent_posts' =&gt; $recent_posts]); \t} <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u0440\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>  <b>\u0428\u0430\u0433 3<\/b><\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b src\/Template\/Cell\/Posts\/display.ctp \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u0443\u0434\u0430 \u043a\u043e\u0434  <\/p>\n<pre><code class=\"php\">&lt;div class=&quot;actions&quot;&gt; \t&lt;h3&gt;&lt;?= __('Recent Posts') ?&gt;&lt;\/h3&gt; \t&lt;ul&gt; \t\t&lt;li&gt;&lt;strong&gt;You have &lt;?= $total_posts ?&gt; posts total&lt;\/strong&gt;&lt;\/li&gt; \t\t&lt;?php  \t\tforeach ($recent_posts as $post) { \t\t\techo &quot;&lt;li&gt;&quot;.$post['title'].&quot;&lt;\/li&gt;&quot;; \t\t} \t\t?&gt; \t&lt;\/ul&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0443\u0442\u043e\u043c\u043b\u044f\u0442\u044c \u0432\u0430\u0441 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u041c\u044b \u043f\u043e\u0447\u0442\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438\u2026 \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0448\u0430\u0433!<\/p>\n<p>  <b>\u0428\u0430\u0433 4<\/b><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433 \u2013 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0442\u0430\u043a, \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e. \u042f \u0445\u043e\u0447\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0438\u0434\u0436\u0435\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b src\/Template\/Layout\/default.ctp \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u0443\u0434\u0430 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430 \u043f\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 $this-&gt;Flash-&gt;render().  <\/p>\n<pre><code class=\"php\">&lt;?php  $cell = $this-&gt;cell('Posts'); ?&gt; &lt;?= $cell ?&gt; <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c. \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u2013 \u0432\u0438\u0434\u0436\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0432 \u043b\u0435\u0432\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0435. \ud83d\ude42<\/p>\n<p>  <b>\u0412\u044b\u0432\u043e\u0434<\/b><\/p>\n<p>  View Cells \u2013 \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 CakePHP. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432. \u042f \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"http:\/\/book.cakephp.org\/3.0\/en\/views\/cells.html\">book.cakephp.org\/3.0\/en\/views\/cells.html<\/a> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0441\u043e\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u0443 \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>  <a name=\"Example3\"><\/a>  <\/p>\n<h3>Events \u0432 CakePHP 3 \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432 4 \u0448\u0430\u0433\u0430<\/h3>\n<p>  \u0412 CakePHP \u0441\u0438\u0441\u0442\u0435\u043c\u0430 Events \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.1, \u0430 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 3.0 \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 Events \u0432 CakePHP \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u043e\u0445\u043e\u0436\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u00ab\u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c\u00bb. \u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 CakePHP \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 2.\u0445, \u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2013 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u041c\u0430\u0440\u0442\u0438\u043d\u0430 \u0411\u0438\u043d\u0430.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u0433\u0434\u0435 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u043c \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u041a\u043b\u0430\u0441\u0441-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e \u043d\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b \u0436\u0443\u0440\u043d\u0430\u043b\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u0431\u043e\u0433 \u0432\u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 Events \u0432 CakePHP 3. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043a\u043b\u0430\u0441\u0441\u044b-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u0435 Events \u0441 \u0447\u0435\u043c-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 Gearman, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0449\u043d\u043e\u0435 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <b>\u0428\u0430\u0433 1<\/b><\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 CakePHP 3 \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0448\u0430\u0431\u043b\u043e\u043d MVC \u0434\u043b\u044f \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439. \u0412\u0438\u0434 \u0432\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0432\u0430\u0436\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u043e\u043b\u0435\u043c ID \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u043c-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p>  <b>\u0428\u0430\u0433 2<\/b><\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b PostsTable.php, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 src\/Model\/Table \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u043c\u0435\u0442\u043e\u0434 afterSave  <\/p>\n<pre><code class=\"php\">    public function afterSave($created, $options = array()) {         if ($created) {              $event = new Event('Model.Post.created', $this, $options);              $this-&gt;eventManager()-&gt;dispatch($event);         }     } <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0412 \u043d\u0435\u043c \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 Event \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abModel.Post.created\u00bb \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 eventManager. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u00ab\u0421\u043b\u043e\u0439.\u041e\u0431\u044a\u0435\u043a\u0442.\u0433\u043b\u0430\u0433\u043e\u043b\u00bb. (\u0431\u044b\u043b\u043e \u00ab\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442\u00bb, \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u00abYou can call your event whatever you want\u00bb)<\/p>\n<p>  <b>\u0428\u0430\u0433 3<\/b><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c. \u041a\u043b\u0430\u0441\u0441-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u2013 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 Cake\\Event\\EventListener. \u041a\u043b\u0430\u0441\u0441\u044b-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 implementedEvents(). \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0432\u0441\u0435\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u043c. \u042f \u0445\u043e\u0447\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Event \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u0443\u0440\u043e\u0432\u043d\u0435, \u043a\u0430\u043a \u0438 \u041c\u043e\u0434\u0435\u043b\u044c, \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438 \u043f\u0440. \u042f \u0437\u0430\u0434\u0430\u043b \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0438\u043c\u0435\u043d App\\Event, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 PSR-4. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c PostListener.php \u0432 \u043f\u0430\u043f\u043a\u0435 Event \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c  <\/p>\n<pre><code class=\"php\">namespace App\\Event;  use Cake\\Log\\Log; use Cake\\Event\\EventListener;  class PostListener implements EventListener {      public function implementedEvents() {         return array(             'Model.Post.created' =&gt; 'updatePostLog',         );     }      public function updatePostLog($event,  $entity, $options) {          Log::write(         'info',         'A new post was published with id: ' . $event-&gt;data['id']);     } } <\/code><\/pre>\n<p>  ImplementedEvents \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043a\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0438 Model.Post.created.\u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 updatePostLog. \u041c\u0435\u0442\u043e\u0434 updatePostLog \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b logs\/debug.log. <\/p>\n<p>  <b>\u0428\u0430\u0433 4<\/b><\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c EventManager. \u0412\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430 config\/bootstrap.php  <\/p>\n<pre><code class=\"php\">use App\\Event\\PostListener; $PostListener = new PostListener();  use Cake\\Event\\EventManager; EventManager::instance()-&gt;attach($PostListener); <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 debug.log \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f<\/p>\n<p>  2014-08-27 04:48:57 Info: A new post was published with id: 14<br \/>  2014-08-27 05:34:27 Info: A new post was published with id: 15<br \/>  2014-08-28 04:44:41 Info: A new post was published with id: 16<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0449\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u2013 <a href=\"http:\/\/book.cakephp.org\/3.0\/en\/core-libraries\/events.html\">book.cakephp.org\/3.0\/en\/core-libraries\/events.html<\/a>. <\/p>\n<p>  <a name=\"Example4\"><\/a>  <\/p>\n<h3>\u0424\u043e\u0440\u043c\u044b Twitter bootstrap \u0432 CakePHP 3<\/h3>\n<p>  \u041c\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u044b\u043b\u043e \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0444\u043e\u0440\u043c Twitter bootstrap \u0432 CakePHP 3. \u0414\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u0432\u0435\u043b\u0438\u0441\u044c \u0432\u043e\u043a\u0440\u0443\u0433 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u041d\u0435\u0443\u0436\u0435\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0444\u043e\u0440\u043c? \u041d\u0443\u0436\u043d\u043e \u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442\u044b? \u0418\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430? \u0412\u043a\u0440\u0430\u0442\u0446\u0435, \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u044b. \u041a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u043c \u044f \u043f\u0435\u0440\u0435\u0439\u0434\u0443 \u043f\u043e\u0437\u0436\u0435, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0438\u0434\u0435<\/p>\n<p>  \u0418 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a<\/p>\n<p>  HTML-\u043a\u043e\u0434 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c  <\/p>\n<pre><code class=\"php\">&lt;div class=&quot;form-group&quot;&gt;   &lt;label for=&quot;title&quot;&gt;Title&lt;\/label&gt;   &lt;div class=&quot;input-group&quot;&gt;     &lt;span class=&quot;input-group-addon&quot;&gt;@&lt;\/span&gt;     &lt;input type=&quot;text&quot; name=&quot;title&quot; class=&quot;form-control&quot; required=&quot;required&quot; maxlength=&quot;50&quot; id=&quot;title&quot;&gt;   &lt;\/div&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0444\u043e\u0440\u043c\u044b \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c  <\/p>\n<pre><code class=\"html\">echo $this-&gt;Form-&gt;input('title', ['addon'=&gt;'@', &quot;class&quot;=&gt;&quot;form-control&quot;]); <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0444\u043e\u0440\u043c-\u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u041e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u0430.<\/p>\n<p>  <b>\u0428\u0430\u0433 1<\/b><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c form-templates.php \u0432 src\/Config\/ folder.<\/p>\n<p>  <b>\u0428\u0430\u0433 2<\/b><\/p>\n<p>  \u0412 \u0444\u0430\u0439\u043b form-templates.php \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 (\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0442\u044d\u0433 php)  <\/p>\n<pre><code class=\"php\">$config = [     'addoninput' =&gt; '&lt;div class=&quot;input-group&quot;&gt;&lt;span class=&quot;input-group-addon&quot;&gt;{{addon}}&lt;\/span&gt;&lt;input type=&quot;{{type}}&quot; name=&quot;{{name}}&quot;{{attrs}}&gt;&lt;\/div&gt;',     'inputContainer' =&gt; '&lt;div class=&quot;form-group&quot;&gt;{{content}}&lt;\/div&gt;',     'inputContainerError' =&gt; '&lt;div class=&quot;form-group has-error has-feedback {{type}}{{required}}&quot;&gt;{{content}}{{error}}&lt;\/div&gt;',     'error' =&gt; '&lt;div class=&quot;alert alert-danger&quot; &gt;{{content}}&lt;\/div&gt;', ]; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c addoninput \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u042f \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b inputContainer, inputContainerError \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 bootstrap.<\/p>\n<p>  <b>\u0428\u0430\u0433 3<\/b><\/p>\n<p>  \u0414\u0432\u0443\u0445 \u0448\u0430\u0433\u043e\u0432 \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u044f \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u043d\u043e \u044f \u0445\u043e\u0447\u0443 \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043a\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u043e \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0414\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0432\u0438\u0434\u0436\u0435\u0442. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 Basic.php \u0438\u0437 cakephp\/src\/View\/Widget \u0432 app\/src\/View\/Widget. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442  <\/p>\n<pre><code class=\"php\">    public function render(array $data, ContextInterface $context) {         $data += [             'name' =&gt; '',             'val' =&gt; null,             'type' =&gt; null,             'escape' =&gt; true,         ];          $data['value'] = $data['val'];         $addon = '';         $template = 'input';          if(isset($data['addon'])) {             $addon = $data['addon'];             $template = 'addoninput';         }          unset($data['val'], $data['addon']);          return $this-&gt;_templates-&gt;format( $template, [             'name' =&gt; $data['name'],             'addon'=&gt; $addon,             'attrs' =&gt; $this-&gt;_templates-&gt;formatAttributes(                 $data,                 ['name', 'type']             ),         ]);     } <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u043c\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 $data \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0432 addoninput.<\/p>\n<p>  <b>\u0428\u0430\u0433 4<\/b><\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u0445 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0444\u043e\u0440\u043c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f  <\/p>\n<pre><code class=\"php\">public $helpers = [      'Form' =&gt; [        'widgets'  =&gt; [          '_default'  =&gt; ['App\\View\\Widget\\Basic'],        ],        'templates' =&gt; 'form-templates.php',     ] ]; <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 CakePHP 2.x \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044b\u043b \u043f\u0440\u043e\u0449\u0435, \u043d\u043e \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0438\u0449\u0435.<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432, \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u0438 \u0444\u043e\u0440\u043c \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u0432:  <\/p>\n<ul>\n<li>\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u2013 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/li>\n<li>\u0443\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430 (\u0434\u0443\u043c\u0430\u044e, \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438) \u2013 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432<\/li>\n<li>\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a HTML 5 \u2013 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430.<\/li>\n<\/ul>\n<p>  <a name=\"Example5\"><\/a>  <\/p>\n<h3>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 CakePHP 3<\/h3>\n<p>  \u0414\u0430, \u0432 CakePHP 2.x \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0434\u043b\u044f \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u0447\u0438\u0441\u0435\u043b \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 \u0434\u043b\u044f \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430<\/p>\n<p>  echo $this-&gt;Paginator-&gt;numbers(array(&#8216;before&#8217; =&gt; &#187;));<\/p>\n<p>  \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043e \u0438 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  \u0412 CakePHP 3 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0432\u0438\u0434\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 PaginatorHelper. \u0428\u0430\u0431\u043b\u043e\u043d\u044b PaginatorHelper \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u0434\u0435\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043e\u0442 \u043a\u043e\u0434\u0430, \u0438 \u043a\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c DRY. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b \u041d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438\u0437 \u0442\u0430\u043a\u043e\u0433\u043e<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/df0\/7d3\/385\/df07d338557544bd8306e6d1c4cc3931.png\"\/> <\/p>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u0439<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/4ff\/00b\/1b6\/4ff00b1b61ce450d9749c6cc0a5d8aaa.png\"\/><\/p>\n<p>  <b>\u0428\u0430\u0433 1<\/b><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c paginator-templates.php \u0432 \u043f\u0430\u043f\u043a\u0435 src\/Config\/.<\/p>\n<p>  <b>\u0428\u0430\u0433 2<\/b><\/p>\n<p>  \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 paginator-templates.php (\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0442\u044d\u0433 php)  <\/p>\n<pre><code class=\"php\">$config = [     'number' =&gt; '&lt;option&gt;{{text}}&lt;\/option&gt;',     'current' =&gt; '&lt;option selected &gt;{{text}}&lt;\/option&gt;', ]; <\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 3<\/b><\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0448\u0430\u0431\u043b\u043e\u043d \u0441 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: Posts\/index.ctp \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438  <\/p>\n<pre><code class=\"php\">echo $this-&gt;Paginator-&gt;prev('&lt; ' . __('previous')); echo $this-&gt;Paginator-&gt;numbers(); echo $this-&gt;Paginator-&gt;next(__('next') . ' &gt;'); <\/code><\/pre>\n<p>  \u043d\u0430   <\/p>\n<pre><code class=\"php\">&lt;form method=&quot;get&quot;&gt;     &lt;label for=&quot;pageselect&quot;&gt;Page number&lt;\/label&gt;     &lt;select name='page' id='pageselect'&gt;           &lt;?= $this-&gt;Paginator-&gt;numbers(); ?&gt;     &lt;\/select&gt;     &lt;button type=&quot;submit&quot;&gt;Go&lt;\/button&gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0412\u0430\u0436\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u2014 $this-&gt;Paginator-&gt;numbers(); \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u043e\u0440\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 GET. \u042f \u043c\u043e\u0433 \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a \u0434\u043b\u044f \u0444\u043e\u0440\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u0444\u043e\u0440\u043c\u044b, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430<\/p>\n<p>  <b>\u0428\u0430\u0433 4<\/b><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440  <\/p>\n<pre><code class=\"php\">    public $helpers = [          'Paginator' =&gt; ['templates' =&gt; 'paginator-templates']          ]; <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043a \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u0441\u043b\u0435 \u043a\u043b\u0438\u043a\u0430 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u041f\u0435\u0440\u0435\u0439\u0442\u0438\u00bb. \u0414\u0430, \u044f \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u0430 \u0444\u043e\u0440\u043c\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0432\u0438\u0434\u0443 \u043e\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0448\u0435, \u043d\u043e \u0442\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b Bootstrap CSS, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. <\/p>\n<p>  <b>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e<\/b><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0438 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043c\u044b \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438\u0437 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432  <\/p>\n<pre><code class=\"php\">public $helpers = [          'Paginator' =&gt; ['templates' =&gt; 'Twit.paginator-templates']          ]; <\/code><\/pre>\n<p>  \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u041d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u043b\u0430\u0433\u0438\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u043c\u044b.<\/p>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0438\u0441\u0442\u043e\u0442\u0430 \u043a\u043e\u0434\u0430 \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0437 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0432\u043e\u0438\u0445 \u043d\u0443\u0436\u0434 \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439  <\/p>\n<pre><code class=\"php\">$config = [     'nextActive' =&gt; '&lt;li class=&quot;next&quot;&gt;&lt;a rel=&quot;next&quot; href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;&lt;\/li&gt;',     'nextDisabled' =&gt; '&lt;li class=&quot;next disabled&quot;&gt;&lt;span&gt;{{text}}&lt;\/span&gt;&lt;\/li&gt;',     'prevActive' =&gt; '&lt;li class=&quot;prev&quot;&gt;&lt;a rel=&quot;prev&quot; href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;&lt;\/li&gt;',     'prevDisabled' =&gt; '&lt;li class=&quot;prev disabled&quot;&gt;&lt;span&gt;{{text}}&lt;\/span&gt;&lt;\/li&gt;',     'counterRange' =&gt; '{{start}} - {{end}} of {{count}}',     'counterPages' =&gt; '{{page}} of {{pages}}',     'first' =&gt; '&lt;li class=&quot;first&quot;&gt;&lt;a href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;&lt;\/li&gt;',     'last' =&gt; '&lt;li class=&quot;last&quot;&gt;&lt;a href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;&lt;\/li&gt;',     'number' =&gt; '&lt;li&gt;&lt;a href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;&lt;\/li&gt;',     'current' =&gt; '&lt;li class=&quot;active&quot;&gt;&lt;span&gt;{{text}}&lt;\/span&gt;&lt;\/li&gt;',     'ellipsis' =&gt; '&lt;li class=&quot;ellipsis&quot;&gt;...&lt;\/li&gt;',     'sort' =&gt; '&lt;a href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;',     'sortAsc' =&gt; '&lt;a class=&quot;asc&quot; href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;',     'sortDesc' =&gt; '&lt;a class=&quot;desc&quot; href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;',     'sortAscLocked' =&gt; '&lt;a class=&quot;asc locked&quot; href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;',     'sortDescLocked' =&gt; '&lt;a class=&quot;desc locked&quot; href=&quot;{{url}}&quot;&gt;{{text}}&lt;\/a&gt;', ];  <\/code><\/pre>\n<p>  <a name=\"Example6\"><\/a>  <\/p>\n<h3>\u0422\u0435\u043c\u044b \u0432 CakePHP 3 \u2013 \u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<\/h3>\n<p>  \u041f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b, \u0438\u043c\u0435\u043b\u043e \u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0442\u0430\u043a \u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440, \u0430 \u0442\u0430\u043a\u0436\u0435 \u044d\u0442\u0438 \u0442\u0435\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb. \u0412 CakePHP 2.x \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0415\u0449\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u043b\u044c\u0444\u0430-\u0440\u0435\u043b\u0438\u0437\u0430 CakePHP 3.x \u044f \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 3 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0435\u043c\u0430\u043c\u0438.<br \/>  \u042f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u044d\u0442\u043e<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/b33\/806\/09a\/b3380609a7b04bfa82dd8f0568b8a5bb.png\"\/><br \/>  <i>\u0422\u0435\u043c\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/i><\/p>\n<p>  \u0432 \u044d\u0442\u043e<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/b10\/e7b\/ca6\/b10e7bca6f8d4e0896d2ab724bad79ac.png\"\/> <br \/>  <i>\u0422\u0435\u043c\u0430 Twitter bootstrap, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c<\/i><\/p>\n<p>  \u042f \u0434\u0443\u043c\u0430\u044e, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c CakePHP 3 \u0438 \u0443\u043c\u0435\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u041c\u043e\u0434\u0435\u043b\u044c, \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0446\u0438\u0438.<\/p>\n<p>  <b>\u0428\u0430\u0433 0<\/b><\/p>\n<p>  \u0414\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c SQL \u0432\u0438\u0434\u0430  <\/p>\n<pre><code class=\"sql\">-- -- Table structure for table `posts` --  CREATE TABLE IF NOT EXISTS `posts` (   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,   `title` varchar(50),   `body` text,   `created` datetime,   `modified` datetime,   PRIMARY KEY (`id`) ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;  -- -- Dumping data for table `posts` --  INSERT INTO `posts` (`id`, `title`, `body`, `created`, `modified`) VALUES (1, 'The title', 'This is the post body.', '2014-02-28 14:15:57', '2014-07-19 11:02:12'), (2, 'A title once again', 'And the post body follows.', '2014-02-28 14:15:57', '2014-07-19 11:02:19'), (3, 'Title strikes back', 'This is really exciting! Not.', '2014-02-28 14:15:57', '2014-07-19 11:02:24'), (5, 'This is a new post', 'Content of new post', '2014-07-19 04:41:18', '2014-07-19 04:41:18'); <\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 1<\/b><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u041c\u043e\u0434\u0435\u043b\u044c \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442\u0435 \u0432 yourapp\/posts, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u044d\u043a\u0440\u0430\u043d, \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442<\/p>\n<p>  <b>\u0428\u0430\u0433 2<\/b><\/p>\n<p>  \u0422\u0435\u043c\u044b \u0432 CakePHP 3 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abTwit\u00bb \u043f\u0443\u0442\u0435\u043c \u0432\u0432\u043e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<p>  Console\/cake bake plugin Twit<\/p>\n<p>  <b>\u0428\u0430\u0433 3<\/b><\/p>\n<p>  \u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0435\u043c\u0443 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Twitter Bootstrap. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 Bootstrap, \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 CSS, \u0448\u0440\u0438\u0444\u0442\u044b \u0438 \u043f\u0430\u043f\u043a\u0443 JS \u0432 plugins\/Twit\/webroot\/. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u043d\u0435\u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u043e, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0442\u043e\u043c.<\/p>\n<p>  <b>\u0428\u0430\u0433 4<\/b><\/p>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432 CakePHP 3 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u0435\u043c\u044b. \u0424\u0430\u0439\u043b\u044b \u0432\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 plugins\/Twit\/src\/Template, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435 plugins\/Twit\/src\/Template \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0432 src\/Template\/ \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043d\u043e\u0432\u043e\u0439 \u0442\u0435\u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 plugins\/Twit\/src\/Template\/Layout. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c default.ctp \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434. \u041d\u0435 \u043f\u0443\u0433\u0430\u0439\u0442\u0435\u0441\u044c, \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430 10-23 \u0438 54-58, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u2013 \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 Twitter Bootstrap.   <\/p>\n<pre><code class=\"html\">&lt;?php $cakeDescription = 'CakePHP: the rapid development php framework'; ?&gt; &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt;   &lt;head&gt;     &lt;?= $this-&gt;Html-&gt;charset(); ?&gt;     &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;     &lt;title&gt;         &lt;?= $cakeDescription; ?&gt;:         &lt;?= $this-&gt;fetch('title'); ?&gt;     &lt;\/title&gt;     &lt;?php         echo $this-&gt;Html-&gt;meta('icon');          echo $this-&gt;Html-&gt;css('bootstrap.min.css');         echo $this-&gt;Html-&gt;css('starter-template.css');          echo $this-&gt;fetch('meta');         echo $this-&gt;fetch('css');         echo $this-&gt;fetch('script');     ?&gt;     &lt;!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --&gt;     &lt;!-- WARNING: Respond.js doesn't work if you view the page via file:\/\/ --&gt;     &lt;!--[if lt IE 9]&gt;       &lt;script src=&quot;https:\/\/oss.maxcdn.com\/html5shiv\/3.7.2\/html5shiv.min.js&quot;&gt;&lt;\/script&gt;       &lt;script src=&quot;https:\/\/oss.maxcdn.com\/respond\/1.4.2\/respond.min.js&quot;&gt;&lt;\/script&gt;     &lt;![endif]--&gt;   &lt;\/head&gt;   &lt;body&gt;      &lt;div class=&quot;navbar navbar-inverse navbar-fixed-top&quot; role=&quot;navigation&quot;&gt;       &lt;div class=&quot;container&quot;&gt;         &lt;div class=&quot;navbar-header&quot;&gt;           &lt;button type=&quot;button&quot; class=&quot;navbar-toggle&quot; data-toggle=&quot;collapse&quot; data-target=&quot;.navbar-collapse&quot;&gt;             &lt;span class=&quot;sr-only&quot;&gt;Toggle navigation&lt;\/span&gt;             &lt;span class=&quot;icon-bar&quot;&gt;&lt;\/span&gt;             &lt;span class=&quot;icon-bar&quot;&gt;&lt;\/span&gt;             &lt;span class=&quot;icon-bar&quot;&gt;&lt;\/span&gt;           &lt;\/button&gt;           &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot;&gt;Project name&lt;\/a&gt;         &lt;\/div&gt;         &lt;div class=&quot;collapse navbar-collapse&quot;&gt;           &lt;ul class=&quot;nav navbar-nav&quot;&gt;             &lt;li class=&quot;active&quot;&gt;&lt;a href=&quot;#&quot;&gt;Home&lt;\/a&gt;&lt;\/li&gt;             &lt;li&gt;&lt;a href=&quot;#about&quot;&gt;About&lt;\/a&gt;&lt;\/li&gt;             &lt;li&gt;&lt;a href=&quot;#contact&quot;&gt;Contact&lt;\/a&gt;&lt;\/li&gt;           &lt;\/ul&gt;         &lt;\/div&gt;&lt;!--\/.nav-collapse --&gt;       &lt;\/div&gt;     &lt;\/div&gt;     &lt;div class=&quot;container&quot;&gt;         &lt;h1&gt;&lt;?= $this-&gt;Html-&gt;link($cakeDescription, 'http:\/\/cakephp.org'); ?&gt;&lt;\/h1&gt;          &lt;?= $this-&gt;Flash-&gt;render(); ?&gt;          &lt;?= $this-&gt;fetch('content'); ?&gt;     &lt;\/div&gt;   &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 5<\/b><\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b index.ctp \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043f\u0430\u043f\u043a\u0443 plugins\/Twit\/src\/Template\/Posts  <\/p>\n<pre><code>&lt;div class=&quot;row&quot;&gt;     &lt;div class=&quot;col-md-8&quot;&gt;         &lt;h2&gt;&lt;?= __('Posts'); ?&gt;&lt;\/h2&gt;         &lt;table class=&quot;table table-bordered&quot;&gt;         &lt;tr&gt;             &lt;th&gt;&lt;?= $this-&gt;Paginator-&gt;sort('id'); ?&gt;&lt;\/th&gt;             &lt;th&gt;&lt;?= $this-&gt;Paginator-&gt;sort('title'); ?&gt;&lt;\/th&gt;             &lt;th&gt;&lt;?= $this-&gt;Paginator-&gt;sort('body'); ?&gt;&lt;\/th&gt;             &lt;th&gt;&lt;?= $this-&gt;Paginator-&gt;sort('created'); ?&gt;&lt;\/th&gt;             &lt;th class=&quot;actions&quot;&gt;&lt;?= __('Actions'); ?&gt;&lt;\/th&gt;         &lt;\/tr&gt;         &lt;?php foreach ($posts as $post): ?&gt;         &lt;tr&gt;             &lt;td&gt;&lt;?= h($post-&gt;id); ?&gt;&nbsp;&lt;\/td&gt;             &lt;td&gt;&lt;?= h($post-&gt;title); ?&gt;&nbsp;&lt;\/td&gt;             &lt;td&gt;&lt;?= h($post-&gt;body); ?&gt;&nbsp;&lt;\/td&gt;             &lt;td&gt;&lt;?= h($post-&gt;created); ?&gt;&nbsp;&lt;\/td&gt;             &lt;td class=&quot;actions&quot;&gt;                 &lt;?= $this-&gt;Html-&gt;link(__('View'), ['action' =&gt; 'view', $post-&gt;id], ['class' =&gt; 'btn btn-sm btn-default']); ?&gt;                 &lt;?= $this-&gt;Html-&gt;link(__('Edit'), ['action' =&gt; 'edit', $post-&gt;id], ['class' =&gt; 'btn btn-sm btn-info']); ?&gt;                 &lt;?= $this-&gt;Form-&gt;postLink(__('Delete'), ['action' =&gt; 'delete', $post-&gt;id], ['confirm' =&gt; __('Are you sure you want to delete # %s?', $post-&gt;id), 'class' =&gt; 'btn btn-sm btn-danger']); ?&gt;             &lt;\/td&gt;         &lt;\/tr&gt;         &lt;?php endforeach; ?&gt;         &lt;\/table&gt;         &lt;p&gt;&lt;?= $this-&gt;Paginator-&gt;counter(); ?&gt;&lt;\/p&gt;         &lt;ul class=&quot;pagination&quot;&gt;         &lt;?php             echo $this-&gt;Paginator-&gt;prev('&lt; ' . __('previous'));             echo $this-&gt;Paginator-&gt;numbers();             echo $this-&gt;Paginator-&gt;next(__('next') . ' &gt;');         ?&gt;         &lt;\/ul&gt;     &lt;\/div&gt;     &lt;div class=&quot;col-md-4&quot;&gt;             &lt;h3&gt;&lt;?= __('Actions'); ?&gt;&lt;\/h3&gt;              &lt;?= $this-&gt;Html-&gt;link(__('New Post'), ['action' =&gt; 'add'], ['class' =&gt; 'btn btn-default']); ?&gt;     &lt;\/div&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 6<\/b><\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b AppController.php \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0442\u0435\u043c\u044b<\/p>\n<p>  public $theme = &#8216;Twit&#8217;;<\/p>\n<p>  <b>\u0428\u0430\u0433 7<\/b><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0439\u0442\u0435\u0441\u044c \u0432\u0438\u0434\u043e\u043c \u0432\u0430\u0448\u0435\u0439 \u043d\u043e\u0432\u043e\u0439 \u0442\u0435\u043c\u044b.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u043c\u044b \u0432 CakePHP \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044b\u043b \u0441\u043b\u0435\u0433\u043a\u0430 \u0437\u0430\u043f\u0443\u0442\u0430\u043d, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0432 \u043f\u043b\u0430\u0433\u0438\u043d \u0442\u0435\u043c\u043e\u0439, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u043b\u0438\u0441\u044c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0441\u0442\u0438\u043b\u044c \u0441\u0441\u044b\u043b\u043e\u043a \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 \u0442\u0435\u043c\u0435, \u043d\u043e, \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. <\/p>\n<p>  <i>\u041c\u0435\u043d\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e \u0442\u0443\u0442\u043e\u0440\u0443:<\/i><br \/>  <a href=\"#Example1\">\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 CakePHP 3 \u2013 \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/a><br \/>  <a href=\"#Example2\">View Cells \u0432 CakePHP 3.0 \u2013 \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/a><br \/>  <a href=\"#Example3\">Events \u0432 CakePHP 3 \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432 4 \u0448\u0430\u0433\u0430<\/a><br \/>  <a href=\"#Example4\">\u0424\u043e\u0440\u043c\u044b Twitter bootstrap \u0432 CakePHP 3<\/a><br \/>  <a href=\"#Example5\">\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 CakePHP 3<\/a><br \/>  <a href=\"#Example6\">\u0422\u0435\u043c\u044b \u0432 CakePHP 3 \u2013 \u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<\/a><\/p>\n<p>  <i>P.S. \u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0431\u044b\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Vircities \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 IlkFinKom. <a href=\"http:\/\/habrahabr.ru\/company\/ilkfinkom\/\">\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043d\u0430\u0448 \u0431\u043b\u043e\u0433<\/a> \u0438 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043a\u0430\u043a \u043f\u0440\u043e \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u0430\u043a \u0438 \u043f\u0440\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/i>   \t<\/p>\n<div class=\"clear\"><\/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\/254489\/\"> http:\/\/habrahabr.ru\/post\/254489\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0432\u044b\u0448\u0435\u043b \u0432 \u0440\u0435\u043b\u0438\u0437 CakePHP 3.0.0.<\/p>\n<p>  \u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 cakephp, \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0431\u044d\u043a\u044d\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u043b\u0435\u0442 \u043c\u044b \u0434\u043e\u0441\u043a\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0432 \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u0445 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430\u0445. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0442 \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043d\u0430 3.0 \u043d\u0430\u043c\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u044b, \u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e cakephp \u0441\u043d\u043e\u0432\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 \u0441\u0435\u0431\u0435 \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/ad2\/29c\/dbf\/ad229cdbf55a4124872169ccca68aa24.jpg\"\/>  <\/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-254238","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254238","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=254238"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254238\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=254238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=254238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=254238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}