{"id":192608,"date":"2013-09-05T10:07:03","date_gmt":"2013-09-05T06:07:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=192608"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=192608","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u043b\u043e\u0433\u0430 \u043d\u0430 Zend Framework 2. \u0427\u0430\u0441\u0442\u044c 2. \u041c\u043e\u0434\u0443\u043b\u044c MyBlog<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Zend Framework 2. <a href=\"http:\/\/habrahabr.ru\/post\/192522\/\">\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 ZendSkeletonApplication, \u0430 \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u0422\u0440\u0435\u0442\u044c\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c Twig.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h2>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 Zend Framework \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u0445 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0448\u0430\u0433\u043e\u0432:  <\/p>\n<ol>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 <em>composer.json<\/em>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u041a\u043e\u043c\u043f\u043e\u0437\u0435\u0440\u0443 \u043e \u043d\u043e\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435,<\/li>\n<li>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>php composer.phar update<\/em>, \u0447\u0442\u043e\u0431\u044b \u041a\u043e\u043c\u043f\u043e\u0437\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0430\u0432\u0442\u043e\u043b\u043e\u0430\u0434 \u0444\u0430\u0439\u043b\u044b,<\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a modules \u0432 \u0444\u0430\u0439\u043b\u0435 <em>config\/application.config.php<\/em>,<\/li>\n<li>\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f (\u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 config \u043c\u043e\u0434\u0443\u043b\u044f) \u0432 config\/autoload \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u043d\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0430\u0432\u043a\u0438.<\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043b\u0435\u0435 \u044f \u0437\u0430\u0434\u0430\u044e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430 \u0438\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f Zend Developer Tools.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>Zend Developer Tools<\/h3>\n<p>  Zend Developer Tools \u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0442\u0443\u043b\u0431\u0430\u0440, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435: \u0447\u0438\u0441\u043b\u043e \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414, \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u043e\u043b\u0435\u0439 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 Entity, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0430\u0439\u0442\u0430 \u0438 \u0442.\u0434. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0442\u0443\u043b\u0431\u0430\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u041d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0443\u0442: <a href=\"https:\/\/github.com\/zendframework\/ZendDeveloperTools\">github.com\/zendframework\/ZendDeveloperTools<\/a>. <\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0443\u043b\u0431\u0430\u0440 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443:  <\/p>\n<pre><code>&quot;zendframework\/zend-developer-tools&quot;: &quot;dev-master&quot;, <\/code><\/pre>\n<p>  \u0432 \u0444\u0430\u0439\u043b <em>composer.json<\/em> \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>php composer.phar update<\/em> \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432 \u0444\u0430\u0439\u043b <em>config\/application.config.php<\/em> \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 modules \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 ZendDeveloperTools:  <\/p>\n<pre><code>'modules' =&gt; array(     'Application',     'ZendDeveloperTools', ), <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <em>vendor\/zendframework\/zend-developer-tools\/config\/zenddevelopertools.local.php.dist<\/em> \u0432 \u043f\u0430\u043f\u043a\u0443 <em>config\/autoload<\/em> \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 <em>zenddevelopertools.local.php<\/em> (\u0447\u0430\u0441\u0442\u044c \u0438\u043c\u0435\u043d\u0438 \u0434\u043e local.php \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442).<\/p>\n<p>  \u0412\u0441\u0451, \u0442\u0435\u043f\u0435\u0440\u044c, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0432\u043d\u0438\u0437\u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0442.\u043f.<\/p>\n<p>  \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0443\u043b\u0431\u0430\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0441\u0435\u043c \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f\u043c \u0441\u0430\u0439\u0442\u0430 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0432 production \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u0430 \u0413\u0438\u0442\u0445\u0430\u0431\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u0442\u044d\u0433\u043e\u043c <em>zenddevelopertools<\/em>: <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/tree\/zenddevelopertools\">github.com\/romka\/zend-blog-example\/tree\/zenddevelopertools<\/a><\/p>\n<h3>Doctrine ORM<\/h3>\n<p>  \u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u043e\u0439 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438 DoctrineModule \u0438 DoctrineORMModule (<a href=\"https:\/\/github.com\/doctrine\/DoctrineModule\">https:\/\/github.com\/doctrine\/DoctrineModule<\/a> \u0438 <a href=\"https:\/\/github.com\/doctrine\/DoctrineORMModule\">github.com\/doctrine\/DoctrineORMModule<\/a>).<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0441\u0435\u043a\u0446\u0438\u044e require \u0444\u0430\u0439\u043b\u0430 composer.json \u0441\u0442\u0440\u043e\u0447\u043a\u0438:  <\/p>\n<pre><code>&quot;doctrine\/common&quot;: &quot;&gt;=2.1&quot;, &quot;doctrine\/doctrine-orm-module&quot;: &quot;0.7.*&quot; <\/code><\/pre>\n<p>  \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>php composer.phar update<\/em>.<\/p>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c DoctrineModule \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044f\u0432\u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c <em>composer.json<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u043e\u0434\u0443\u043b\u044f DoctrineORMModule.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>config\/autoload<\/em> \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0444\u0430\u0439\u043b <em>doctrine.local.php<\/em> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u043e\u0439, \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code>&lt;?php return array(     'doctrine' =&gt; array(         'connection' =&gt; array(             'orm_default' =&gt; array(                 'driverClass' =&gt;'Doctrine\\DBAL\\Driver\\PDOMySql\\Driver',                 'params' =&gt; array(                     'host'     =&gt; 'localhost',                     'port'     =&gt; '3306',                     'user'     =&gt; 'username',                     'password' =&gt; 'pass',                     'dbname'   =&gt; 'dbname',                 )             )         ),     ), ); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0442\u043e \u0432\u043d\u0438\u0437\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 Zend \u0434\u0435\u0432\u043b\u043e\u043f\u0435\u0440 \u0442\u0443\u043b\u0431\u0430\u0440\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u0430, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0447\u0438\u0441\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u0432 \u043a \u0411\u0414. \u041e\u0431\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0438 \u043c\u044b \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0431\u0430\u0437\u0435 \u043d\u0435\u0442.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0431\u043b\u043e\u0433 \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c MyBlog<\/h2>\n<p>  \u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <em>modules<\/em> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0444\u0430\u0439\u043b\u044b:  <\/p>\n<pre><code>MyBlog\/     config\/         module.config.php     src\/         MyBlog\/             Entity\/                 BlogPost.php     Module.php <\/code><\/pre>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 <em>Module.php<\/em> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code>&lt;?php namespace MyBlog;  class Module {   public function getAutoloaderConfig()   {     return array(       'Zend\\Loader\\StandardAutoloader' =&gt; array(         'namespaces' =&gt; array(           __NAMESPACE__ =&gt; __DIR__ . '\/src\/' . __NAMESPACE__,         ),       ),     );   }    public function getConfig()   {     return include __DIR__ . '\/config\/module.config.php';   } } <\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 Application, \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u044f\u0434\u0440\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0433\u0434\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0444\u0430\u0439\u043b\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u043a\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u044b \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>  \u0424\u0430\u0439\u043b <em>src\/MyBlog\/Entity\/BlogPost.php<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u044c\u044e (\u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u043c) \u043c\u0435\u0436\u0434\u0443 \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u043e\u0439 \u0438 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e \u043d\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h3>BlogPost.php<\/h3>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442 \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f:  <\/p>\n<ul>\n<li>\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a,<\/li>\n<li>\u0442\u0435\u043b\u043e \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430,<\/li>\n<li>id \u0430\u0432\u0442\u043e\u0440\u0430 (0 \u0434\u043b\u044f \u0430\u043d\u043e\u043d\u0438\u043c\u043e\u0432),<\/li>\n<li>\u0441\u0442\u0430\u0442\u0443\u0441 (\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e\/\u043d\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e)<\/li>\n<li>\u0434\u0430\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u044f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u0432 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u044d\u0433\u0430\u043c\u0438, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u0433\u0430\u043c \u0444\u0438\u0447\u0430\u043c\u0438.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 BlogPost, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0438\u043c. \u041f\u043e\u043b\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0413\u0438\u0442\u0445\u0430\u0431\u0435 (<a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Entity\/BlogPost.php\">https:\/\/github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Entity\/BlogPost.php<\/a>), \u0432\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c:  <\/p>\n<pre><code>&lt;?php namespace MyBlog\\Entity;  use Doctrine\\Common\\Collections\\ArrayCollection; use Doctrine\\ORM\\Mapping as ORM;  class BlogPost {   \/**    * @var int    * @ORM\\Id    * @ORM\\Column(type=&quot;integer&quot;)    * @ORM\\GeneratedValue(strategy=&quot;AUTO&quot;)    *\/   protected $id;    \/**    * @var string    * @ORM\\Column(type=&quot;string&quot;, length=255, nullable=false)    *\/   protected $title;    \/**    * Get id.    *    * @return int    *\/   public function getId()   {     return $this-&gt;id;   }    \/**    * Set id.    *    * @param int $id    *    * @return void    *\/   public function setId($id)   {     $this-&gt;id = (int) $id;   }    \/**    * Get title.    *    * @return string    *\/   public function getTitle()   {     return $this-&gt;title;   }    \/**    * Set title.    *    * @param string $title    *    * @return void    *\/   public function setTitle($title)   {     $this-&gt;title = $title;   }  } <\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0434\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043b\u0435\u043c \u0432 \u0411\u0414, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u043b\u0435\u0439 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u044b \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u043e\u0439 (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a: <a href=\"http:\/\/php.net\/manual\/en\/reflectionclass.getdoccomment.php\">php.net\/manual\/en\/reflectionclass.getdoccomment.php<\/a>, \u043a\u043b\u0430\u0441\u0441 <em>Doctrine\\Common\\Annotations\\AnnotationReader<\/em> \u043c\u0435\u0442\u043e\u0434 getClassAnnotations()).<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f <em>config\/module.config.php<\/em> \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0448\u0435\u0439 \u043d\u043e\u0432\u043e\u0439 Entity, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u043e\u0439:  <\/p>\n<pre><code>return array(     'doctrine' =&gt; array(         'driver' =&gt; array(             'myblog_entity' =&gt; array(                 'class' =&gt;'Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver',                 'paths' =&gt; array(__DIR__ . '\/..\/src\/MyBlog\/Entity')             ),             'orm_default' =&gt; array(                 'drivers' =&gt; array(                     'MyBlog\\Entity' =&gt; 'myblog_entity',                 )             )         )     ), ); <\/code><\/pre>\n<p>  \u0418 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c MyBlog \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 <em>application.config.php<\/em>.<\/p>\n<p>  \u041c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 BlogPost \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0441 \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u043e\u0439. \u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  <\/p>\n<pre><code>.\/vendor\/bin\/doctrine-module orm:info <\/code><\/pre>\n<p>  \u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code>Found 1 mapped entities: [OK]   MyBlog\\Entity\\BlogPost <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u0430 \u0432\u0438\u0434\u0438\u0442 \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 BlogPost \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  <\/p>\n<pre><code>.\/vendor\/bin\/doctrine-module orm:validate-schema <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code>[Mapping]  OK - The mapping files are correct. [Database] FAIL - The database schema is not in sync with the current mapping file. <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043f\u0443\u0441\u0442\u0430 \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:  <\/p>\n<pre><code>.\/vendor\/bin\/doctrine-module orm:schema-tool:update --force <\/code><\/pre>\n<p>  \u0415\u0451 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434:  <\/p>\n<pre><code>Updating database schema... Database schema updated successfully! &quot;1&quot; queries were executed <\/code><\/pre>\n<p>  \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code>.\/vendor\/bin\/doctrine-module orm:validate-schema <\/code><\/pre>\n<p>  \u0432\u0435\u0440\u043d\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code>[Mapping]  OK - The mapping files are correct. [Database] OK - The database schema is in sync with the mapping files. <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0442\u043e \u0432 \u0442\u0443\u043b\u0431\u0430\u0440\u0435 \u0432\u043d\u0438\u0437\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u0430 \u0432\u0438\u0434\u0438\u0442 \u043e\u0434\u0438\u043d \u043c\u0430\u043f\u043f\u0438\u043d\u0433 Myblog\\Entity\\BlogPost.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u0413\u0438\u0442\u0445\u0430\u0431\u0435 \u0441 \u0442\u044d\u0433\u043e\u043c <em>blogpost_entity<\/em>: <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/tree\/blogpost_entity\">github.com\/romka\/zend-blog-example\/tree\/blogpost_entity<\/a>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430.<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430<\/h3>\n<p>  \u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 src\/MyBlog \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438:  <\/p>\n<pre><code>Controller\/     BlogController.php Form\/     BlogPostForm.php     BlogPostInputFilter.php <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f, \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438 \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438:  <\/p>\n<pre><code>'controllers' =&gt; array(     'invokables' =&gt; array(         'MyBlog\\Controller\\BlogPost' =&gt; 'MyBlog\\Controller\\BlogController',     ), ),  'router' =&gt; array(     'routes' =&gt; array(         'blog' =&gt; array(             'type'    =&gt; 'segment',             'options' =&gt; array(                 'route'    =&gt; '\/blog[\/][:action][\/:id]',                 'constraints' =&gt; array(                     'action' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',                     'id'     =&gt; '[0-9]+',                 ),                 'defaults' =&gt; array(                     'controller' =&gt; 'MyBlog\\Controller\\BlogPost',                     'action'     =&gt; 'index',                 ),             ),         ),     ), ),  'view_manager' =&gt; array(     'template_path_stack' =&gt; array(         __DIR__ . '\/..\/view',     ), ), <\/code><\/pre>\n<p>  \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u0432\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0443\u0440\u043b\u044b \u0432\u0438\u0434\u0430 <em>blog\/[action]\/[id]<\/em> (\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u0443\u0442\u0438 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b).<\/p>\n<p>  \u0424\u0430\u0439\u043b <em>BlogPostForm.php<\/em> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f\/\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443.<\/p>\n<h3>BlogPostForm.php<\/h3>\n<p>  \u0412 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0444\u043e\u0440\u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a (\u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u043e\u0440\u043c\u044b, \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0443\u0442: <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Form\/BlogPostForm.php\">github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Form\/BlogPostForm.php<\/a>):  <\/p>\n<pre><code>class BlogPostForm extends Form {     public function __construct($name = null)     {         parent::__construct('blogpost');         $this-&gt;setAttribute('method', 'post');         $this-&gt;add(array(             'name' =&gt; 'id',             'type' =&gt; 'Hidden',         ));         $this-&gt;add(array(             'name' =&gt; 'title',             'type' =&gt; 'Text',             'options' =&gt; array(                 'label' =&gt; 'Title',             ),             'options' =&gt; array(                 'min' =&gt; 3,                 'max' =&gt; 25             ),         ));         $this-&gt;add(array(             'name' =&gt; 'text',             'type' =&gt; 'Textarea',             'options' =&gt; array(                 'label' =&gt; 'Text',             ),         ));         $this-&gt;add(array(             'name' =&gt; 'state',             'type' =&gt; 'Checkbox',         ));         $this-&gt;add(array(             'name' =&gt; 'submit',             'type' =&gt; 'Submit',             'attributes' =&gt; array(                 'value' =&gt; 'Save',                 'id' =&gt; 'submitbutton',             ),         ));     } } <\/code><\/pre>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u043f\u043e\u043b\u044f \u0444\u043e\u0440\u043c\u044b, \u043d\u043e \u043f\u043e\u043a\u0430 \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d\u044b \u043d\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b (\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435), \u043d\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u0444\u043e\u0440\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435). \u0418\u0445 \u043c\u044b \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u0437\u0436\u0435, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<h3>BlogController.php<\/h3>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 (<a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Controller\/BlogController.php\">https:\/\/github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Controller\/BlogController.php<\/a>), \u043d\u0438\u0436\u0435 \u0435\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c:  <\/p>\n<pre><code>class BlogController extends AbstractActionController {      public function indexAction()     {         return new ViewModel();     }      public function addAction()     {         $form = new \\MyBlog\\Form\\BlogPostForm();         $form-&gt;get('submit')-&gt;setValue('Add');          $request = $this-&gt;getRequest();         if ($request-&gt;isPost()) {             $form-&gt;setData($request-&gt;getPost());              if ($form-&gt;isValid()) {                 $objectManager = $this-&gt;getServiceLocator()-&gt;get('Doctrine\\ORM\\EntityManager');                  $blogpost = new \\MyBlog\\Entity\\BlogPost();                  $blogpost-&gt;exchangeArray($form-&gt;getData());                  $blogpost-&gt;setCreated(time());                 $blogpost-&gt;setUserId(0);                  $objectManager-&gt;persist($blogpost);                 $objectManager-&gt;flush();                  \/\/ Redirect to list of blogposts                 return $this-&gt;redirect()-&gt;toRoute('blog');             }         }         return array('form' =&gt; $form);     } } <\/code><\/pre>\n<p>  \u0417\u043d\u0430\u0447\u0438\u043c\u044b\u043c \u0434\u043b\u044f \u043d\u0430\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u044d\u043a\u0448\u0435\u043d\u0430 addAction (\u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u044d\u043a\u0448\u0435\u043d\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0430\u0441\u043a\u0435 nameAction()). \u0412 \u043d\u0435\u043c \u043c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0444\u043e\u0440\u043c\u044b \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u043a\u043d\u043e\u043f\u043a\u0438 submit \u043d\u0430 \u043d\u0435\u0439 (\u0443 \u043d\u0430\u0441 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u0444\u043e\u0440\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0438 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u043e\u0432, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043a\u0441\u0442\u044b \u043d\u0430 \u044d\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435):  <\/p>\n<pre><code>$form = new \\MyBlog\\Form\\BlogPostForm(); $form-&gt;get('submit')-&gt;setValue('Add'); <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e (\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u043d\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043a\u0430 \u043d\u0435\u0442) \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \\MyBlog\\Entity\\BlogPost(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u044c\u044e \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0411\u0414, \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0445 \u0432 \u0411\u0414:  <\/p>\n<pre><code>$blogpost-&gt;exchangeArray($form-&gt;getData());  $blogpost-&gt;setCreated(time()); $blogpost-&gt;setUserId(0);  $objectManager-&gt;persist($blogpost); $objectManager-&gt;flush(); <\/code><\/pre>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0437\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u044b, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/blogpost_form_1\/module\/MyBlog\/view\/my-blog\/blog\/add.phtml\">github.com\/romka\/zend-blog-example\/blob\/blogpost_form_1\/module\/MyBlog\/view\/my-blog\/blog\/add.phtml<\/a>. <\/p>\n<p>  \u0415\u0441\u043b\u0438 c\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u0443\u044e \u0444\u043e\u0440\u043c\u0443, \u0442\u043e \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code>An exception occurred while executing 'INSERT INTO blogposts (title, text, userId, created, state) VALUES (?, ?, ?, ?, ?)' with params [null, null, 0, 1377086855, null]:  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0432\u0435\u0434\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u0430\u043a nullable=\u00abtrue\u00bb \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u0435 state, \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0444\u043e\u0440\u043c\u0435 \u0438\u043d\u043f\u0443\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0435\u0449\u0435 \u0434\u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 (\u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0411\u0414), \u0447\u0442\u043e\u0431\u044b \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<h3>\u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0444\u043e\u0440\u043c<\/h3>\n<p>  \u0412 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <em>BlogPostInputFilter.php<\/em> \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 (\u043f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 \u0413\u0438\u0442\u0445\u0430\u0431\u0435: <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Form\/BlogPostInputFilter.php\">github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/Form\/BlogPostInputFilter.php<\/a>):  <\/p>\n<pre><code>class BlogPostInputFilter extends InputFilter {     public function __construct()     {         $this-&gt;add(array(             'name' =&gt; 'title',             'required' =&gt; true,             'validators' =&gt; array(                 array(                     'name' =&gt; 'StringLength',                     'options' =&gt; array(                         'min' =&gt; 3,                         'max' =&gt; 100,                     ),                 ),             ),             'filters' =&gt; array(                 array('name' =&gt; 'StripTags'),                 array('name' =&gt; 'StringTrim'),             ),          ));          $this-&gt;add(array(             'name' =&gt; 'text',             'required' =&gt; true,             'validators' =&gt; array(                 array(                     'name' =&gt; 'StringLength',                     'options' =&gt; array(                         'min' =&gt; 50,                     ),                 ),             ),             'filters' =&gt; array(                 array('name' =&gt; 'StripTags'),                 array('name' =&gt; 'StringTrim'),             ),         ));          $this-&gt;add(array(             'name' =&gt; 'state',             'required' =&gt; false,         ));     } } <\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0441\u043c\u044b\u0441\u043b \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c: \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 title \u0438 text \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u043f\u0443\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u0430\u043b\u044f\u0442 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0432\u0441\u0435 html \u0442\u044d\u0433\u0438 (\u0444\u043b\u044c\u0442\u0440 StripTags) \u0438 \u043e\u0431\u0440\u0435\u0436\u0443\u0442 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u043f\u043e \u043a\u0440\u0430\u044f\u043c \u0441\u0442\u0440\u043e\u043a (StrinTrim), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u043b\u0435\u0439 (StringLength).<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u043a \u0444\u043e\u0440\u043c\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441 \u0444\u043e\u0440\u043c\u044b \u0441\u0442\u0440\u043e\u0447\u043a\u0443:  <\/p>\n<pre><code>$this-&gt;setInputFilter(new \\MyBlog\\Form\\BlogPostInputFilter()); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<h3>View \u043f\u043b\u0430\u0433\u0438\u043d\u044b<\/h3>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d (\u0438\u043b\u0438 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d) \u043c\u044b \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \/blog, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u043e\u0432. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442, \u043d\u043e \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432:   <\/p>\n<pre><code>$this-&gt;flashMessenger()-&gt;addMessage($message); $this-&gt;flashMessenger()-&gt;addErrorMessage($message); <\/code><\/pre>\n<p>  \u0418\u0437\u0432\u043b\u0435\u0447\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0438\u043b\u0438 \u0432 phtml-\u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code>$object-&gt;flashMessenger()-&gt;getMessages(); $object-&gt;flashMessenger()-&gt;getErrorMessages(); <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e (\u0430 \u0432 Twig-\u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0438 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e) \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c PHP-\u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 View-\u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 src\\MyBlog \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043a\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0444\u0430\u0439\u043b\u044b:  <\/p>\n<pre><code>View\\     Helper\\         ShowMessages.php <\/code><\/pre>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <em>ShowMessages.php<\/em> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442: <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/View\/Helper\/ShowMessages.php\">github.com\/romka\/zend-blog-example\/blob\/master\/module\/MyBlog\/src\/MyBlog\/View\/Helper\/ShowMessages.php<\/a>, \u043e\u043d\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044f \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u044e \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 html-\u043a\u043e\u0434 \u0434\u043b\u044f \u0438\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0440\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:  <\/p>\n<ol>\n<li>\u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c View-\u043f\u043b\u0430\u0433\u0438\u043d,<\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d,<\/li>\n<li>\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c\/\u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0444\u043e\u0440\u043c\u044b.<\/li>\n<\/ol>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0441\u0435\u0446\u043a\u0438\u044e view_helper =&gt; invokables \u0441\u0442\u0440\u043e\u0447\u043a\u0443:  <\/p>\n<pre><code>'view_helpers' =&gt; array(     'invokables' =&gt; array(         'showMessages' =&gt; 'MyBlog\\View\\Helper\\ShowMessages',     ), ), <\/code><\/pre>\n<p>  \u0412 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u044b\u0432\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:  <\/p>\n<pre><code>print $this-&gt;showMessages(); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438:   <\/p>\n<pre><code>$message = 'Blogpost succesfully saved!'; $this-&gt;flashMessenger()-&gt;addMessage($message); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u042d\u0442\u0443 \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u0433\u0438\u0442-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0441 \u0442\u044d\u0433\u043e\u043c <em>blogpost_form_1<\/em>: <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/tree\/blogpost_form_1\">github.com\/romka\/zend-blog-example\/tree\/blogpost_form_1<\/a>. <\/p>\n<p>  \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c:  <\/p>\n<ol>\n<li>\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0411\u0414, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0414\u043e\u043a\u0442\u0440\u0438\u043d\u044b,<\/li>\n<li>\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430,<\/li>\n<li>\u0444\u043e\u0440\u043c\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430 \u0441 \u0438\u043d\u043f\u0443\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439,<\/li>\n<li>\u0441\u0432\u043e\u0439 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 View-\u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/li>\n<\/ol>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430, \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u043e\u0432 \u0438 \u0444\u043e\u0440\u043c\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430.<\/p>\n<h3>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430<\/h3>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 BlogpostController \u043d\u043e\u0432\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 view:  <\/p>\n<pre><code>public function viewAction() {     $id = (int) $this-&gt;params()-&gt;fromRoute('id', 0);     if (!$id) {         $this-&gt;flashMessenger()-&gt;addErrorMessage('Blogpost id doesn\\'t set');         return $this-&gt;redirect()-&gt;toRoute('blog');     }      $objectManager = $this-&gt;getServiceLocator()-&gt;get('Doctrine\\ORM\\EntityManager');      $post = $objectManager         -&gt;getRepository('\\MyBlog\\Entity\\BlogPost')         -&gt;findOneBy(array('id' =&gt; $id));      if (!$post) {         $this-&gt;flashMessenger()-&gt;addErrorMessage(sprintf('Blogpost with id %s doesn\\'t exists', $id));         return $this-&gt;redirect()-&gt;toRoute('blog');     }      $view = new ViewModel(array(         'post' =&gt; $post-&gt;getArrayCopy(),     ));      return $view; } <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u044d\u043a\u0448\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 blog\/view\/ID. \u0412 \u043d\u0435\u043c \u043c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0432 URL\u2019\u0435 \u0437\u0430\u0434\u0430\u043d id \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 id \u0443\u043a\u0430\u0437\u0430\u043d, \u0442\u043e \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043f\u043e\u0441\u0442 \u0438\u0437 \u0431\u0430\u0437\u044b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u0448\u0430\u0431\u043b\u043e\u043d. <\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f view\/my-blog\/blog \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b view.phtml \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:  <\/p>\n<pre><code>&lt;?php     print $this-&gt;showMessages();     print '&lt;h1&gt;' . $post['title'] . '&lt;\/h1&gt;';     print '&lt;div&gt;' . $post['text'] . '&lt;\/div&gt;'; <\/code><\/pre>\n<h3>\u0421\u043f\u0438\u0441\u043e\u043a \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u043e\u0432<\/h3>\n<p>  \u041e\u0431\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e indexAction \u0434\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code>public function indexAction() {     $objectManager = $this-&gt;getServiceLocator()-&gt;get('Doctrine\\ORM\\EntityManager');      $posts = $objectManager         -&gt;getRepository('\\MyBlog\\Entity\\BlogPost')         -&gt;findBy(array('state' =&gt; 1), array('created' =&gt; 'DESC'));      $view = new ViewModel(array(         'posts' =&gt; $posts,     ));      return $view; } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u044b (state == 1), \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u043f\u043e \u0434\u0430\u0442\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u0448\u0430\u0431\u043b\u043e\u043d <em>index.phtml<\/em> <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/blogpost_form_2\/module\/MyBlog\/view\/my-blog\/blog\/index.phtml\">github.com\/romka\/zend-blog-example\/blob\/blogpost_form_2\/module\/MyBlog\/view\/my-blog\/blog\/index.phtml<\/a>. \u0412 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u043e\u0432 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0412\u044b\u0448\u0435, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0444\u043e\u0440\u043c\u044b \u044f \u0437\u0430\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 userId, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a \u0430\u0432\u0442\u043e\u0440\u0430 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438\/\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043d\u0435\u0442, \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u043c, \u043d\u043e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043e\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u0444\u043e\u0440\u043c\u0443 hidden \u043f\u043e\u043b\u0435 userId.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a \u0444\u043e\u0440\u043c\u0435 Csrf-\u0442\u043e\u043a\u0435\u043d (\u043f\u043e\u043b\u0435 security), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u043e\u0442 \u043f\u043e\u0434\u0434\u0435\u043b\u043a\u0438. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0442 \u0442\u043e\u043a\u0435\u043d \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438 \u0441\u043e\u043b\u0438 \u0438 \u0436\u0438\u0432\u0435\u0442 300 \u0441\u0435\u043a\u0443\u043d\u0434 (<em>Zend\\Form\\Element\\Csrf.php<\/em>), \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c (\u0438 \u043f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c) \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0438 \u043a \u043d\u0435\u043c\u0443 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 ip \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f.<\/p>\n<h3>\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430<\/h3>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0444\u043e\u0440\u043c\u0443. \u0412 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 editAction(), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443, \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u042d\u0442\u043e\u0442 \u044d\u043a\u0448\u0435\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043c\u0435\u0441\u044c\u044e addAction(), \u0432 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u043e\u0440\u043c\u043e\u0439, \u0438 viewAction(), \u0432 \u0447\u0430\u0441\u0442\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/blogpost_form_2\/module\/MyBlog\/src\/MyBlog\/Controller\/BlogController.php#L95\">github.com\/romka\/zend-blog-example\/blob\/blogpost_form_2\/module\/MyBlog\/src\/MyBlog\/Controller\/BlogController.php#L95<\/a>.<\/p>\n<p>  \u0412\u043e\u0442 \u0441\u0430\u043c\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430:  <\/p>\n<pre><code>if ($form-&gt;isValid()) {     $objectManager = $this-&gt;getServiceLocator()-&gt;get('Doctrine\\ORM\\EntityManager');      $data = $form-&gt;getData();     $id = $data['id'];     try {         $blogpost = $objectManager-&gt;find('\\MyBlog\\Entity\\BlogPost', $id);     }     catch (\\Exception $ex) {         return $this-&gt;redirect()-&gt;toRoute('blog', array(             'action' =&gt; 'index'         ));     }      $blogpost-&gt;exchangeArray($form-&gt;getData());      $objectManager-&gt;persist($blogpost);     $objectManager-&gt;flush();      $message = 'Blogpost succesfully saved!';     $this-&gt;flashMessenger()-&gt;addMessage($message);      \/\/ Redirect to list of blogposts     return $this-&gt;redirect()-&gt;toRoute('blog'); } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0437 \u0411\u0414 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 id, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0435\u043b \u0432 \u0444\u043e\u0440\u043c\u0435, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435:  <\/p>\n<pre><code>$blogpost-&gt;exchangeArray($form-&gt;getData()); <\/code><\/pre>\n<p>  \u0438 \u043a\u043b\u0430\u0434\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442 \u0432 \u0431\u0430\u0437\u0443:  <\/p>\n<pre><code>$objectManager-&gt;persist($blogpost); $objectManager-&gt;flush(); <\/code><\/pre>\n<h3>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u043e\u0432<\/h3>\n<p>  \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0444\u043e\u0440\u043c\u0443 \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0432\u0438\u0434\u0430 \u201d\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u0441\u0442?\u201d \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u043c\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u201c\u0414\u0430\u201d, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p>  \u041a\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0413\u0438\u0442\u0445\u0430\u0431\u0435: <a href=\"https:\/\/github.com\/romka\/zend-blog-example\/blob\/blogpost_form_2\/module\/MyBlog\/src\/MyBlog\/Controller\/BlogController.php#L161\">github.com\/romka\/zend-blog-example\/blob\/blogpost_form_2\/module\/MyBlog\/src\/MyBlog\/Controller\/BlogController.php#L161<\/a>.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0441 \u0442\u044d\u0433\u043e\u043c <em>blogpost_form_2<\/em> (https:\/\/github.com\/romka\/zend-blog-example\/tree\/blogpost_form_2) \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0444\u043e\u0440\u043c\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442\u0430, \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u0432 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438. \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u043c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 Twig.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/192608\/\"> http:\/\/habrahabr.ru\/post\/192608\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Zend Framework 2. <a href=\"http:\/\/habrahabr.ru\/post\/192522\/\">\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 ZendSkeletonApplication, \u0430 \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u0422\u0440\u0435\u0442\u044c\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c Twig.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h2>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 Zend Framework \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u0445 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0448\u0430\u0433\u043e\u0432:  <\/p>\n<ol>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 <em>composer.json<\/em>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u041a\u043e\u043c\u043f\u043e\u0437\u0435\u0440\u0443 \u043e \u043d\u043e\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435,<\/li>\n<li>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>php composer.phar update<\/em>, \u0447\u0442\u043e\u0431\u044b \u041a\u043e\u043c\u043f\u043e\u0437\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0430\u0432\u0442\u043e\u043b\u043e\u0430\u0434 \u0444\u0430\u0439\u043b\u044b,<\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a modules \u0432 \u0444\u0430\u0439\u043b\u0435 <em>config\/application.config.php<\/em>,<\/li>\n<li>\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f (\u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 config \u043c\u043e\u0434\u0443\u043b\u044f) \u0432 config\/autoload \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u043d\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0430\u0432\u043a\u0438.<\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043b\u0435\u0435 \u044f \u0437\u0430\u0434\u0430\u044e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430 \u0438\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f Zend Developer Tools.  <\/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-192608","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192608","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=192608"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192608\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}