{"id":274245,"date":"2016-02-14T23:28:01","date_gmt":"2016-02-14T20:28:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=274245"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=274245","title":{"rendered":"Yii 2.0.7"},"content":{"rendered":"<p>       \u0412\u044b\u0448\u043b\u0430 \u0432\u0435\u0440\u0441\u0438\u044f 2.0.7 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yii. \u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"http:\/\/www.yiiframework.com\/download\/\">http:\/\/www.yiiframework.com\/download\/<\/a>.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/2.0.7\/framework\/CHANGELOG.md\">\u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0442\u043d\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439<\/a>, \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0435\u0451 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/2.0.7\/framework\/UPGRADE.md\">UPGRADE.md<\/a>.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u043d\u0430\u0448\u0435\u043c\u0443 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/graphs\/contributors\">\u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u0430\u043b\u043e \u043d\u0430\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u043b\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432 \u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439. \u0411\u0435\u0437 \u0432\u0430\u0441 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b. \u0421\u043f\u0430\u0441\u0438\u0431\u043e!<\/p>\n<p>  \u0417\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Yii \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0443 \u0438\u043b\u0438 \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 watch <a href=\"https:\/\/github.com\/yiisoft\/yii2\">\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 GitHub<\/a>. \u0422\u0430\u043a\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <a href=\"https:\/\/twitter.com\/yiiframework\">Twitter<\/a> \u0438 <a href=\"https:\/\/www.facebook.com\/groups\/yiitalk\/\">\u0433\u0440\u0443\u043f\u043f\u0430 \u0432 Facebook<\/a>.<\/p>\n<p>  \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0412\u0430\u0434\u0438\u0434\u0430\u0442\u043e\u0440 IP<\/h2>\n<p>  \u041d\u043e\u0432\u044b\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c IP \u043d\u0430 \u0447\u0451\u0442\u043a\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435, \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0438 \u043c\u0430\u0441\u043a\u0438. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440, \u0442\u0430\u043a \u0438 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430 <code>rules()<\/code> \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"php\">public function rules() {     return [         ['address', 'ip', 'ranges' =&gt; [              '192.168.10.128'              '!192.168.10.0\/24',              'any' \/\/ \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430         ]],     ]; } <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u044b <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/guide-tutorial-core-validators.html#ip\">\u0432 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435<\/a>, <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-validators-ipvalidator.html\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043a\u043b\u0430\u0441\u0441\u0443<\/a> \u0438<br \/>  <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/2.0.7\/tests\/framework\/validators\/IpValidatorTest.php\">\u0442\u0435\u0441\u0442\u0430\u0445<\/a>.<\/p>\n<h2>i18n<\/h2>\n<p>  \u0424\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440 \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>asDuration()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e <a href=\"http:\/\/php.net\/manual\/ru\/class.dateinterval.php\">\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c DateInterval<\/a>, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0435\u043a\u0443\u043d\u0434 \u0438\u043b\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/ISO_8601\">\u0441\u0442\u0440\u043e\u043a\u043e\u0439 ISO8601<\/a>:<\/p>\n<pre><code class=\"php\">echo Yii::$app-&gt;formatter-&gt;asDuration(131); \/\/ \u0432\u044b\u0432\u0435\u0434\u0435\u0442 &quot;2 minutes, 11 seconds&quot; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0447\u0435\u0440\u0435\u0437 <code>yii\\i18n\\Formatter::$calendar<\/code> \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c, \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u041f\u0435\u0440\u0441\u0438\u0434\u0441\u043a\u0438\u0439 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c:<\/p>\n<pre><code class=\"php\">Yii::$app-&gt;formatter-&gt;locale = 'fa_IR@calendar=persian'; Yii::$app-&gt;formatter-&gt;calendar = \\IntlDateFormatter::TRADITIONAL; Yii::$app-&gt;formatter-&gt;timeZone = 'UTC'; $value = 1451606400; \/\/ Fri, 01 Jan 2016 00:00:00 (UTC) echo Yii::$app-&gt;formatter-&gt;asDate($value, 'php:Y'); \/\/ \u0432\u044b\u0432\u0435\u0434\u0435\u0442 &quot;\u06f1\u06f3\u06f9\u06f4&quot; <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-i18n-formatter.html#$calendar-detail\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u043a\u043b\u0430\u0441\u0441\u0443<\/a>.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043d\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 URL \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u0430\u043a <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-helpers-baseinflector.html#transliterate()-detail\"><code>Inflector::transliterate()<\/code><\/a>, \u0447\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u044f\u0437\u044b\u043a\u0438, \u043a\u0430\u043a \u0412\u044c\u0435\u0442\u043d\u0430\u043c\u0441\u043a\u0438\u0439.<\/p>\n<h2>\u0411\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0432 \u0440\u0435\u043b\u0438\u0437 \u0431\u044b\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439. \u0412 <code>Query::groupBy()<\/code> \u0438 <code>Query::orderBy()<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>yii\\db\\Expression<\/code>:<\/p>\n<pre><code class=\"php\">$expression = new Expression('SUBSTR(name, 2)'); $users = (new \\yii\\db\\Query)     -&gt;from('user')     -&gt;orderBy($expression)     -&gt;limit(10)     -&gt;all(); <\/code><\/pre>\n<p>  \u0414\u043b\u044f SQLite \u0441\u0442\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u043e\u0432 \u0432 DSN:<\/p>\n<pre><code class=\"php\">'db' =&gt; [     'dsn' =&gt; 'sqlite:@app\/db\/database.sqlite3', ] <\/code><\/pre>\n<p>  \u0414\u043b\u044f JOIN \u0441 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0432 Active Record \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0432 <code>join()<\/code>, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 <code>joinWith()<\/code>:<\/p>\n<pre><code class=\"php\">\/\/ join-\u0438\u043c \u0441 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438 \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e orders.id $query-&gt;joinWith(['orders o'])-&gt;orderBy('o.id'); <\/code><\/pre>\n<h2>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432 \u043d\u043e\u0432\u043e\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439<\/h2>\n<p>  \u041d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439, \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0432 2.0.6, \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <code>unsigned<\/code>:<\/p>\n<pre><code class=\"php\">'createdBy' =&gt; $this-&gt;integer(10)-&gt;unsigned(), <\/code><\/pre>\n<p>  \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"php\">$this-&gt;integer()-&gt;defaultExpression('CURRENT_TIMESTAMP'); <\/code><\/pre>\n<h2>\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439<\/h2>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>.\/yii migrate\/create<\/code> \u0441\u0442\u0430\u043b\u0430 \u0443\u043c\u043d\u0435\u0435. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u043d\u0430 \u043d\u0430\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code>.\/yii migrate\/create create_post --fields=title:string,body:text <\/code><\/pre>\n<p>  \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442:<\/p>\n<pre><code class=\"php\">class m150811_220037_create_post extends Migration {     public function up()     {         $this-&gt;createTable('post', [             'id' =&gt; $this-&gt;primaryKey(),             'title' =&gt; $this-&gt;string(),             'body' =&gt; $this-&gt;text()         ]);     }      public function down()     {         $this-&gt;dropTable('post');     } } <\/code><\/pre>\n<p>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/guide-db-migrations.html#generating-migrations\">\u0432 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435<\/a>. \u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0431\u0435\u0440\u0435\u0436\u0451\u0442 \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<h2>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 RBAC<\/h2>\n<p>  \u0412 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 RBAC \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043c\u0435\u0442\u043e\u0434 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-rbac-managerinterface.html#getUserIdsByRole()-detail\"><code>getUserIdsByRole()<\/code><\/a>. \u041e\u043d \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0430\u0434\u043c\u0438\u043d\u043a\u0438 \u0434\u043b\u044f \u0440\u043e\u043b\u0435\u0439 \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043e\u043a<\/h2>\n<ul>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u043e\u0434\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a PHP 5.5 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 JSON. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 JSON \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c.<\/li>\n<li><code>VarDumper::dump()<\/code> \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c PHP <code>__debugInfo()<\/code>.<\/li>\n<li>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u0438\u0437 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <code>$_ENV<\/code> \u0438 <code>$_SERVER<\/code> \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u0448\u0438\u0431\u043e\u043a. \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-web-errorhandler.html#$displayVars-detail\"><code>yii\\web\\ErrorHandler::$displayVars<\/code><\/a>.<\/li>\n<li><code>yii\\helpers\\VarDumper::export()<\/code> \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c\u0438.<\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/277201\/\"> https:\/\/habrahabr.ru\/post\/277201\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412\u044b\u0448\u043b\u0430 \u0432\u0435\u0440\u0441\u0438\u044f 2.0.7 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yii. \u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"http:\/\/www.yiiframework.com\/download\/\">http:\/\/www.yiiframework.com\/download\/<\/a>.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/2.0.7\/framework\/CHANGELOG.md\">\u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0442\u043d\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439<\/a>, \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0435\u0451 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/2.0.7\/framework\/UPGRADE.md\">UPGRADE.md<\/a>.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u043d\u0430\u0448\u0435\u043c\u0443 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/graphs\/contributors\">\u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u0430\u043b\u043e \u043d\u0430\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u043b\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432 \u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439. \u0411\u0435\u0437 \u0432\u0430\u0441 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b. \u0421\u043f\u0430\u0441\u0438\u0431\u043e!<\/p>\n<p>  \u0417\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Yii \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0443 \u0438\u043b\u0438 \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 watch <a href=\"https:\/\/github.com\/yiisoft\/yii2\">\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 GitHub<\/a>. \u0422\u0430\u043a\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <a href=\"https:\/\/twitter.com\/yiiframework\">Twitter<\/a> \u0438 <a href=\"https:\/\/www.facebook.com\/groups\/yiitalk\/\">\u0433\u0440\u0443\u043f\u043f\u0430 \u0432 Facebook<\/a>.<\/p>\n<p>  \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430.  <\/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-274245","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274245","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=274245"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274245\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}