{"id":185236,"date":"2013-07-01T17:52:02","date_gmt":"2013-07-01T13:52:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=185236"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=185236","title":{"rendered":"<span class=\"post_title\">\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 Yii 2 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0445\u0430\u0431\u0440\u0430\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u043b\u0438 \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c \u043e \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Yii. \u042f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043d\u0430 \u0436\u0438\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0432\u0430\u0441 \u0441 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c Yii 2.<\/p>\n<p>  \u041f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u043b\u043e\u0433\u0430 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0448\u0430\u0433\u0438 \u0441\u0445\u043e\u0436\u0438 \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u043d\u043e \u044f \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e \u0442\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u0438 \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u043d\u043e\u0432\u0438\u043d\u043a\u0430\u0445 Yii2 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u0441\u0451 \u0436\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/vova07\/yii2-blog\">\u0434\u0435\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a>, \u0447\u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p>  \u0412 Yii2 \u043a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0432\u0441\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043d\u0430 namespace, \u044d\u0442\u043e \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0437\u044e\u043c\u0438\u043d\u043a\u0430 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. <br \/>  \u0422\u0430\u043a\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u00abC\u00bb \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0438\u0437 \u0438\u043c\u0451\u043d \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0451\u043d.<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c basic \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<br \/>  \u041a\u0430\u043a \u0435\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/tree\/master\/apps\/basic\">Github<\/a> \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0443\u043d\u043a\u0442\u0430\u043c.<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0443\u0437\u043d\u0430\u0442\u044c \u0438 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 Yii2. <br \/>  \u0418\u0442\u0430\u043a \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043d\u0430\u043c, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u00abmodules\u00bb, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043f\u043a\u0438 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0422\u0443\u0442 \u0432\u0441\u0435 \u043a\u0430\u043a \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0434\u0443\u043b\u044f. \u041a\u0430\u043a \u044f \u043f\u043e\u043d\u044f\u043b \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 \u00abModule\u00bb, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0448\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0431\u0435\u0437 \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u0430.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440:<\/b><br \/>  Site.php, Users.php, Blogs.php, \u0438.\u0442.\u0434.<br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0436\u0435 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: config\/main.php<\/h4>\n<p>  \u041a\u0430\u043a \u0438 \u0432 Yii 1.0 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b\u0430 main.php, \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u043e \u0432\u0441\u0451 \u0442\u0430\u043a\u0438 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <b>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439:<\/b>  <\/p>\n<ul>\n<li>\u041f\u0440\u0438\u0440\u043a\u0443\u0442\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00abclass\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043c\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0434\u0443\u043b\u044f, \u0438 \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<br \/> \n<pre><code class=\"php\">'modules' =&gt; array( ... \t\t'users' =&gt; array( \t\t\t'class' =&gt; 'app\\modules\\users\\Users' \t\t), ... \t), <\/code><\/pre>\n<p>  <\/li>\n<li>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00abdefaultController\u00bb \u0443\u0431\u0440\u0430\u043b\u0438 \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u00abdefaultRoute\u00bb.<\/li>\n<li>\u041f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0443\u0442\u0435\u0439 \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u043b\u0438\u0430\u0441\u044b &quot;<code>@app, @www, @wwwroot<\/code>&quot;, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e.<\/li>\n<li>\u0412 UrlManager \u0442\u043e\u0436\u0435 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u00aburlFormat\u00bb \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u043d\u0430 \u00abenablePrettyUrl\u00bb, \u00abuseStrictParsing\u00bb \u043d\u0430 \u00abenableStrictParsing\u00bb.<\/li>\n<li>\u0412 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u00abdb\u00bb \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043b\u0438 \u00abconnectionString\u00bb \u043d\u0430 \u00abdsn\u00bb.<\/li>\n<\/ul>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0431\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u0444\u0440\u0435\u0439\u043c\u0430.<br \/>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043d\u0430\u0448\u0438 \u043c\u043e\u0434\u0443\u043b\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u00abCRUD\u00bb.<\/p>\n<h4>CRUD<\/h4>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u0442\u044c \u0432 \u0434\u0435\u043c\u043e \u043a\u043e\u0434\u0435, \u043d\u043e \u0435\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435\u0442. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0442\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u043e\u0432\u043e\u0435, \u044d\u0442\u043e \u0440\u0430\u043d\u0435\u0435 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430: populate(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d \u043d\u0430 \u0434\u043d\u044f\u0445 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d \u0432 load(). \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u0430\u0441\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u00abrender()\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u0435\u0451 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u00abecho\u00bb, \u0432\u043c\u0435\u0441\u0442\u043e \u00abreturn\u00bb. (\u0412 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u0445\u043e\u0442\u044f \u0432 basic \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0437\u0430\u0431\u044b\u043b\u0438, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0441\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e)<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440:<\/b>  <\/p>\n<pre><code class=\"php\">public function actionCreate() \t{ \t\t$model = new Blog(); \t\tif ($model-&gt;load($_POST) && $model-&gt;validate()) { \t\t\tif ($model-&gt;save()) \t\t\t\treturn Yii::$app-&gt;response-&gt;redirect(array('view', 'id' =&gt; $model-&gt;id)); \t\t} else { \t\t\techo $this-&gt;render('create', array('model' =&gt; $model)); \t\t} \t} <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">$model-&gt;load($_POST) \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e if (isset($_POST['Blog'])) {     $model-&gt;attributes = $_POST['Blog']; } <\/code><\/pre>\n<p>  \u0414\u0440\u0443\u0433\u0438\u0445 \u043e\u0441\u043e\u0431\u044b\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 CRUD \u043d\u0435\u0442.<\/p>\n<h4>\u041c\u043e\u0434\u0435\u043b\u044c<\/h4>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u00abscenarios()\u00bb \u0437\u0430 \u0441\u0447\u0451\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f.  <\/p>\n<pre><code class=\"php\">public function scenarios() {     return array(         'backend' =&gt; array('email', 'role'),         'frontend' =&gt; array('email', '!name'),     ); } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0451\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 formName() \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043c\u044f \u041a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 model() \u0443\u0431\u0440\u0430\u043b\u0438, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c:  <\/p>\n<pre><code class=\"php\"> MyModel::getAuthor(); <\/code><\/pre>\n<p>  <\/p>\n<h4>ActivRecord<\/h4>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u0432 Yii2 \u043d\u043e\u0432\u044b\u0439 AR \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0434\u0443\u0435\u0442.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439:<\/b><br \/>  \u00abscopes()\u00bb \u0431\u044b\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b AR \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u043c\u0435\u044e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434:  <\/p>\n<pre><code class=\"php\">public function active($query) \t{ \t\treturn $query-&gt;andWhere('status = ' . self::STATUS_ACTIVE); \t} <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u00abrelations()\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0433\u0435\u0442\u0435\u0440\u0440\u043e\u0432, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 relations: \u00abhasOne()\u00bb, \u00abhasMany()\u00bb.  <\/p>\n<pre><code class=\"php\">public function getAuthor() \t{ \t\treturn $this-&gt;hasOne('app\\modules\\users\\models\\User', array('id' =&gt; 'author_id'));                 \/\/ \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u044d\u0442\u043e \u0443 \u043d\u0430\u0441 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0432\u044f\u0437\u044c.                \/\/ \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0438\u043c\u044f \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e PK \u043a\u043b\u044e\u0447\u0430  (id) \u0438 FK \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0434\u0435\u043b\u0438 (author_id), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \t} <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0438\u0437 \u0431\u0430\u0437\u044b, \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u043e\u0432\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"php\">$customers = Customer::find()     -&gt;where(array('status' =&gt; $active))     -&gt;orderBy('id')     -&gt;all(); \/\/ return the customer whose PK is 1 $customer = Customer::find(1); $customers = Customer::find(array('status'=&gt;$active)); $customers = Customer::find()-&gt;asArray()-&gt;all(); $customers = Customer::find()-&gt;active()-&gt;asArray()-&gt;all(); <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, AR \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a \u0431\u0430\u0437\u0435, \u0437\u0430 \u0441\u0447\u0451\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 tableName()&quot; \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u00abtbl_MODEL_NAME\u00bb. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043c\u043e\u0434\u0435\u043b\u044c \u00abUser\u00bb, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u00abtbl_user\u00bb. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e.  <\/p>\n<h4>\u0421\u043e\u0431\u044b\u0442\u0438\u044f<\/h4>\n<p>  \u0412 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0441\u0442\u0430\u043b\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0412 \u0434\u0435\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u044f \u043f\u0440\u0438\u0432\u0451\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0445\u043e\u0442\u044f \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 Yii, \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00abEVENT_AFTER_INSERT\u00bb.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432 \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u0441\u0442\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u00abtrigger()\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440:<\/b>  <\/p>\n<pre><code class=\"php\">\u0444\u0430\u0439\u043b app\\modules\\users\\models\\User ... public function afterSave($insert) \t{                \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \t\t$event = new ModelEvent; \t\t$this-&gt;trigger(self::EVENT_NEW_USER, $event);  \t\tparent::afterSave($insert); \t} ...  \u0444\u0430\u0439\u043b app\\modules\\users\\controllers\\DefaultController ... public function actionSignup() \t{ \t\t$model = new User(); \t\t$model-&gt;scenario = 'signup'; \t\tif ($model-&gt;load($_POST) && $model-&gt;validate()) { \t\t\tif (!$this-&gt;module-&gt;activeAfterRegistration)                                 \/\/ \u0437\u0430\u0434\u0430\u0451\u043c \u043d\u0430\u0448 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f [[EVENT_NEW_USER]] \t\t\t\t$model-&gt;on($model::EVENT_NEW_USER, array($this-&gt;module, 'onNewUser')); \t\t\tif ($model-&gt;save()) { \t\t\t\tYii::$app-&gt;session-&gt;setFlash('success'); \t\t\t\treturn Yii::$app-&gt;response-&gt;refresh(); \t\t\t} \t\t} else { \t\t\techo $this-&gt;render('signup', array('model' =&gt; $model)); \t\t} \t} ... <\/code><\/pre>\n<p>  <b>\u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430:<\/b>  <\/p>\n<pre><code class=\"php\">function ($event) { ... }         \/\/ \u0410\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f array($object, 'handleClick')    \/\/ $object-&gt;handleClick() array('Page', 'handleClick')     \/\/ Page::handleClick() 'handleClick'                    \/\/ \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f  \u0444\u0443\u043d\u043a\u0446\u0438\u044f handleClick() <\/code><\/pre>\n<p>  <\/p>\n<h4>View<\/h4>\n<p>  \u0412 Yii2 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0432\u043e\u0434 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 view \u0444\u0430\u0439\u043b\u0430\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f $this \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0443\u0436\u0435 \u043d\u0435 \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u043d\u043e\u0432\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u00abyii\\base\\View\u00bb.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438\u043b\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043a \u043c\u0435\u0442\u043e\u0434\u0443: \u00abcontext\u00bb.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440:<\/b>  <\/p>\n<pre><code class=\"php\">\/\/ \u0424\u0430\u0439\u043b app\\modules\\blogs\\views\\default\\index \/\/ $this-&gt;context \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0444\u0430\u0439\u043b\u0443 app\\modules\\blogs\\controllers\\DefaultController \/\/ \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f echo $this-&gt;context-&gt;module-&gt;recordsPerPage; \/\/ \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 10  \/\/\u0424\u0430\u0439\u043b app\\modules\\comments\\widgets\\comments\\views\\index \/\/ $this-&gt;context \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0444\u0430\u0439\u043b\u0443 app\\modules\\comments\\widgets\\comments\\Comments if ($this-&gt;context-&gt;model['id'] == 10 ) {...} <\/code><\/pre>\n<p>  <\/p>\n<h4>Widgets<\/h4>\n<p>  \u0412\u0438\u0434\u0436\u0435\u0442\u044b \u0431\u044b\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u043e\u0432\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0438 \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 render() \u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u00abecho\u00bb.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440:<\/b>  <\/p>\n<pre><code class=\"php\">\/\/ Note that you have to &quot;echo&quot; the result to display it echo \\yii\\widgets\\Menu::widget(array('items' =&gt; $items));  \/\/ Passing an array to initialize the object properties $form = \\yii\\widgets\\ActiveForm::begin(array(     'options' =&gt; array('class' =&gt; 'form-horizontal'),     'fieldConfig' =&gt; array('inputOptions' =&gt; array('class' =&gt; 'input-xlarge')), )); ... form inputs here ... \\yii\\widgets\\ActiveForm::end(); <\/code><\/pre>\n<p>  <\/p>\n<h4>Action Filters<\/h4>\n<p>  \u0412 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u00abbehaviors\u00bb.   <\/p>\n<pre><code class=\"php\">public function behaviors() \t{ \t\treturn array( \t\t\t'access' =&gt; array( \t\t\t\t'class' =&gt; \\yii\\web\\AccessControl::className(), \t\t\t\t'rules' =&gt; array( \t\t\t\t    \/\/ allow authenticated users \t\t\t\t\tarray( \t\t\t\t\t\t'allow' =&gt; true, \t\t\t\t\t\t'actions' =&gt; array('login', 'signup', 'activation'), \t\t\t\t\t\t'roles' =&gt; array('?') \t\t\t\t\t), \t\t\t\t\tarray( \t\t\t\t\t\t'allow' =&gt; true, \t\t\t\t\t\t'actions' =&gt; array('logout'), \t\t\t\t\t\t'roles' =&gt; array('@') \t\t\t\t\t), \t\t\t\t\tarray( \t\t\t\t\t\t'allow' =&gt; true, \t\t\t\t\t\t'actions' =&gt; array('index', 'view'), \t\t\t\t\t\t'roles' =&gt; array('guest') \t\t\t\t\t), \t\t\t\t\tarray( \t\t\t\t\t\t'allow' =&gt; true, \t\t\t\t\t\t'actions' =&gt; array('edit', 'delete'), \t\t\t\t\t\t'roles' =&gt; array('@') \t\t\t\t\t), \t\t\t\t\t\/\/ deny all \t\t\t\t\tarray( \t\t\t\t\t\t'allow' =&gt; false \t\t\t\t\t) \t\t\t\t) \t\t\t) \t\t); \t} <\/code><\/pre>\n<p>  \u041c\u0435\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043d\u044e\u0430\u043d\u0441 \u2014 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e 2 \u0440\u043e\u043b\u0438:  <\/p>\n<ul>\n<li>@ \u2014 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 <\/li>\n<li>? \u2014 \u0433\u043e\u0441\u0442\u0438<\/li>\n<li> * \u2014 \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>Static Helpers<\/h4>\n<p>  \u0412 Yii2 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043c\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u044b\u0445 \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0442\u043e\u0442 \u0436\u0435 SecurityHelper \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0430\u043c\u0438, ArrayHelper, Html, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0427\u0442\u043e \u0441\u043d\u043e\u0432\u0430 \u0440\u0430\u0434\u0443\u0435\u0442.<\/p>\n<h4>ActiveForm<\/h4>\n<p>  \u0424\u043e\u0440\u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0435\u0449\u0451 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u0437\u0430 \u0441\u0447\u0451\u0442 ActiveField \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0447\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c.  <\/p>\n<pre><code class=\"php\">&lt;?php $form = ActiveForm::begin(array('options' =&gt; array('class' =&gt; 'form-horizontal'))); echo $form-&gt;field($model, 'username')-&gt;textInput($model-&gt;isNewRecord ? array() : array('readonly' =&gt; true)); echo $form-&gt;field($model, 'email')-&gt;textInput(); if (!$model-&gt;isNewRecord) {     if (Yii::$app-&gt;user-&gt;checkAccess('editProfile')) {         echo $form-&gt;field($model, 'status')-&gt;dropDownList(array(         \tUser::STATUS_ACTIVE =&gt; 'Active',         \tUser::STATUS_INACTIVE =&gt; 'Inactive',         \tUser::STATUS_DELETED =&gt; 'Deleted'         ));         echo $form-&gt;field($model, 'role')-&gt;dropDownList(array(         \tUser::ROLE_USER =&gt; 'User',         \tUser::ROLE_ADMIN =&gt; 'Admin'         ));     } \techo $form-&gt;field($model, 'oldpassword')-&gt;passwordInput(); } echo $form-&gt;field($model, 'password')-&gt;passwordInput(); echo $form-&gt;field($model, 'repassword')-&gt;passwordInput(); ?&gt;  &lt;div class=&quot;form-actions&quot;&gt; \t&lt;?php echo Html::submitButton($model-&gt;isNewRecord ? 'Register' : 'Update', array('class' =&gt; 'btn btn-primary')); ?&gt; &lt;\/div&gt;  &lt;?php ActiveForm::end(); ?&gt; <\/code><\/pre>\n<p>  <\/p>\n<h4>User and Identity<\/h4>\n<p>  \u0420\u043e\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0441\u0441 yii\\web\\User \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 yii\\web\\Identity \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<br \/>  \u0418\u0437-\u0437\u0430 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 identity \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440: <\/b>  <\/p>\n<pre><code class=\"php\">echo Yii::$app-&gt;user-&gt;identity-&gt;username; <\/code><\/pre>\n<p>  <\/p>\n<h4>URL Management<\/h4>\n<p>  \u0422\u0443\u0442 \u0447\u0443\u0442\u043e\u043a \u0432\u0438\u0434\u043e\u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0441\u0442\u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440: <\/b>  <\/p>\n<pre><code class=\"php\">... array(   'dashboard' =&gt; 'site\/index',  'PUT post\/&lt;id:\\d+&gt;' =&gt; 'post\/update',  'POST,PUT post\/index' =&gt; 'post\/create',   'POST &lt;controller:\\w+&gt;s' =&gt; '&lt;controller&gt;\/create',   '&lt;controller:\\w+&gt;s' =&gt; '&lt;controller&gt;\/index',  'PUT &lt;controller:\\w+&gt;\/&lt;id:\\d+&gt;'    =&gt; '&lt;controller&gt;\/update',  'DELETE &lt;controller:\\w+&gt;\/&lt;id:\\d+&gt;' =&gt; '&lt;controller&gt;\/delete',  '&lt;controller:\\w+&gt;\/&lt;id:\\d+&gt;'        =&gt; '&lt;controller&gt;\/view', ); ... <\/code><\/pre>\n<p>  <\/p>\n<h4>RBAC<\/h4>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0431\u0435\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<br \/>  <b>\u041d\u0438\u0436\u0435 \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u0440\u043e RBAC \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u043e\u043b\u0435\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435.<\/b><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \\yii\\rbac\\PhpManager.<br \/>  \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u00abrbac\u00bb \u0432 \u043f\u0430\u043f\u043a\u0435 \u00abcomponents\u00bb \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abPhpManager.php\u00bb<br \/>  \u041a\u043e\u0434 \u0432 \u043d\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0451\u043c \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u043e\u043b\u044f\u043c\u0438, \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u0440\u043e\u043b\u0438.  <\/p>\n<pre><code class=\"php\">&lt;?php  namespace app\\modules\\rbac\\components;  use Yii;  class PhpManager extends \\yii\\rbac\\PhpManager {     public function init()     {         if ($this-&gt;authFile === NULL)             $this-&gt;authFile = Yii::getAlias('@app\/modules\/rbac\/components\/rbac') . '.php';           parent::init();           if (!Yii::$app-&gt;user-&gt;isGuest)             $this-&gt;assign(Yii::$app-&gt;user-&gt;identity-&gt;id, Yii::$app-&gt;user-&gt;identity-&gt;role);     } } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435, \u0432 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u043f\u043a\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0430\u0439\u043b \u00abrbac.php\u00bb \u0433\u0434\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0440\u043e\u043b\u0438. (\u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0434\u0435\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0432 \u043f\u0430\u043f\u043a\u0435: <code>@app\/modules\/rbac\/components\/rbac<\/code>)<\/p>\n<p>  \u041d\u0443 \u0438 \u043d\u0430 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c authManager \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435:  <\/p>\n<pre><code class=\"php\">... 'authManager' =&gt; array( \t\t\t'class' =&gt; 'app\\modules\\rbac\\components\\PhpManager', \t\t\t'defaultRoles' =&gt; array('guest'), \t\t), ... <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043d\u0430\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043c\u0435\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u0440\u0430\u0432:  <\/p>\n<pre><code class=\"php\">if (Yii::$app-&gt;user-&gt;checkAccess('editOwnBlog', array('blog' =&gt; $model)) || Yii::$app-&gt;user-&gt;checkAccess('editBlog')) { ... } <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0432\u0441\u0435 \u0447\u0442\u043e \u044f \u0443\u0441\u043f\u0435\u043b \u0443\u0437\u043d\u0430\u0442\u044c, \u043d\u043e \u0443\u0432\u0435\u0440\u0435\u043d \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u0441\u043f\u0435\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043d\u0435 \u0443\u0441\u043f\u0435\u043b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 ajax \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432 Yii 2, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412 1.0 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:   <\/p>\n<pre><code class=\"php\">echo CActiveForm::validate($model); <\/code><\/pre>\n<p>  \u0435\u0441\u043b\u0438 \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043f\u0438\u0448\u0438\u0442\u0435, \u0443\u0432\u0435\u0440\u0435\u043d \u043c\u043d\u043e\u0433\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e.<\/p>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0435\u0449\u0451 \u043d\u0435\u0434\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u0432\u0438\u0434, Yii 2 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u0423\u0432\u0435\u0440\u0435\u043d \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043d\u0430\u0441 \u0436\u0434\u0451\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0443\u0447\u0448\u0435\u0435.<\/p>\n<p>  \u0421\u0430\u043c\u043e\u043c\u0443 Yii 2 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f. \u0415\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0445\u043e\u0442\u044f \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0435\u0449\u0451 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u043d\u043e.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0423\u0434\u0430\u0447\u0438!<\/p>\n<p>  <a href=\"https:\/\/github.com\/vova07\/yii2-blog\">\u0414\u0435\u043c\u043e \u0431\u043b\u043e\u0433 \u043d\u0430 Github.<\/a> \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442.<br \/>  <a href=\"http:\/\/yii2-blog.find-freelancer.pro\/www\/\">\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u043b\u043e\u0433\u0430.<\/a> \t\t\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\/185236\/\"> http:\/\/habrahabr.ru\/post\/185236\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0445\u0430\u0431\u0440\u0430\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u043b\u0438 \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c \u043e \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Yii. \u042f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043d\u0430 \u0436\u0438\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0432\u0430\u0441 \u0441 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c Yii 2.<\/p>\n<p>  \u041f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u043b\u043e\u0433\u0430 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0448\u0430\u0433\u0438 \u0441\u0445\u043e\u0436\u0438 \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u043d\u043e \u044f \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e \u0442\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u0438 \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u043d\u043e\u0432\u0438\u043d\u043a\u0430\u0445 Yii2 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u0441\u0451 \u0436\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/vova07\/yii2-blog\">\u0434\u0435\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a>, \u0447\u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442.  <\/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-185236","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/185236","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=185236"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/185236\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=185236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=185236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=185236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}