{"id":208556,"date":"2014-01-11T22:35:02","date_gmt":"2014-01-11T18:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208556"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208556","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f standalone actions \u0432 Yii2<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c, \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u0437\u0430\u043d\u0443\u0434\u043d\u043e. \u041a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 Standalone actions \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/>  <a name=\"habracut\"><\/a><br \/>  <b>\u041a\u043e\u0440\u043e\u0442\u043a\u043e, \u0447\u0442\u043e \u044d\u0442\u043e<\/b>: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e action-\u0430 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c. \u0422\u0430\u043a \u0431\u0430\u0437\u043e\u0432\u044b\u0439 SiteController \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/packagist.org\/packages\/yiisoft\/yii2-app-basic\">basic application template<\/a> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0434\u0432\u0430 action-\u0430\u200a\u2014\u200a\u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 captcha:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435 action-\u043e\u0432 \u043a SiteController<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  namespace app\\controllers;  use Yii; use yii\\web\\Controller;  class SiteController extends Controller {     public function actions()     {         return [             'error' =&gt; [                 'class' =&gt; 'yii\\web\\ErrorAction',             ],             'captcha' =&gt; [                 'class' =&gt; 'yii\\captcha\\CaptchaAction',                 'fixedVerifyCode' =&gt; YII_ENV_TEST ? 'testme' : null,             ],         ];     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h5>\u0427\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e<\/h5>\n<p>  <\/p>\n<ol>\n<li>ListAction \u2014 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/master\/docs\/guide\/controller.md#standalone-actions\">standalone action<\/a>, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043f\u043e\u0438\u0441\u043a\u0430.<\/li>\n<li>DataProvider \u2014 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0430 \u043d\u0430\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443.<\/li>\n<li>Search <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/master\/docs\/guide\/model.md\">Model<\/a> \u2014 \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 DataProvider \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.<\/li>\n<\/ol>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0449\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 CRUD-\u0430\u0445 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/master\/docs\/guide\/gii.md\">gii<\/a>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u043c \u0432\u044b\u043d\u043e\u0441 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0432 \u0441\u0430\u043c\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 AR (\u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0432 yii1). \u041d\u043e \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u044b\u043d\u043e\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u0430\u0451\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438.<\/p>\n<h5>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ListAction<\/h5>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c run, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a action-\u0443. \u041a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 yii\\base\\Action. Action-\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0435 \u043a \u0435\u0433\u043e \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443, \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u0412 \u043d\u0430\u0448 action \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 action-\u0430, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (view), \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438 \u0438 \u0442.\u043f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  namespace app\\modules\\shop\\actions;  use Yii; use yii\\base; use yii\\web\\Response; use app\\modules\\shop\\components\\FilterModelBase; use yii\\widgets\\LinkPager;  class ListAction extends base\\Action {      \/**      * \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430      * @var FilterModelBase      *\/     protected $_filterModel;      \/**      * \u0410\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f-\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0430\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430      * @var callable      *\/     protected $_validationFailedCallback;      \/**      * \u041c\u0435\u0442\u043e\u0434 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430,      * \u0415\u0441\u043b\u0438 true, \u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u043f\u043e\u0434-\u043c\u0430\u0441\u0441\u0438\u0432\u0435 e.g. $_GET\/$_POST[SearchModel][attribute]      * @var bool      *\/     public $directPopulating = true;      \/**      * \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 true, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 html \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438,      * \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f AJAX \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432      * @var bool      *\/     public $paginationAsHTML = false;      \/**      * \u0422\u0438\u043f \u0437\u0430\u043f\u0440\u043e\u0441\u0430      * @var string      *\/     public $requestType = 'get';      \/**      * \u041f\u0443\u0441\u0442\u044c \u0434\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f      * @var string      *\/     public $view = '@app\/modules\/shop\/views\/list\/index';      public function run()     {         if (!$this-&gt;_filterModel) {             throw new base\\ErrorException('\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430');         }          $request = Yii::$app-&gt;request;          if ($request-&gt;isAjax) {             Yii::$app-&gt;response-&gt;format = Response::FORMAT_JSON;         }          \/\/ \u041f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435         $data = (strtolower($this-&gt;requestType) === 'post' && $request-&gt;isPost) ? $_POST : $_GET;         $this-&gt;_filterModel-&gt;load(($this-&gt;directPopulating) ? $data : [$this-&gt;_filterModel-&gt;formName() =&gt; $data]);          \/\/ \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430         $this-&gt;_filterModel-&gt;search();          \/\/ \u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438         if ($this-&gt;_filterModel-&gt;hasErrors()) {              \/**              * \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0440\u0435\u0448\u0430\u0435\u043c \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c,              * \u0435\u0441\u043b\u0438 ajax \u0442\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443, \u0438\u043d\u0430\u0447\u0435 \u0435\u0441\u043b\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0442, \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438              *\/             if ($request-&gt;isAjax){                 return (is_callable($this-&gt;_validationFailedCallback))                     ? call_user_func($this-&gt;_validationFailedCallback, $this-&gt;_filterModel)                     : [                         'error' =&gt; current($this-&gt;_filterModel-&gt;getErrors())                     ];             }              if (empty($data)) {                 $this-&gt;_filterModel-&gt;clearErrors();             }          }          if (!($dataProvider = $this-&gt;_filterModel-&gt;getDataProvider())) {             throw new base\\ErrorException('\u041d\u0435 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d DataProvider');         }          if ($request-&gt;isAjax) {             \/\/ \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432             return [                 'list' =&gt; $this-&gt;_filterModel-&gt;buildModels(),                 'pagination' =&gt; ($this-&gt;paginationAsHTML)                         ? LinkPager::widget([                                 'pagination' =&gt; $dataProvider-&gt;getPagination()                             ])                         : $dataProvider-&gt;getPagination()             ];         }          return $this-&gt;controller-&gt;render($this-&gt;view ?: $this-&gt;id, [                 'filterModel' =&gt; $this-&gt;_filterModel,                 'dataProvider' =&gt; $dataProvider,                 'requestType' =&gt; $this-&gt;requestType,                 'directPopulating' =&gt; $this-&gt;directPopulating             ]);      }      public function setFilterModel(FilterModelBase $model)     {         $this-&gt;_filterModel = $model;     }      public function setValidationFailedCallback(callable $callback)     {         $this-&gt;_validationFailedCallback = $callback;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 Ajax \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php use yii\\widgets\\ActiveForm; use yii\\helpers\\Html; \/**  * @var \\yii\\web\\View $this  * @var \\yii\\data\\DataProviderInterface $dataProvider  * @var \\app\\modules\\shop\\components\\FilterModelBase $filterModel  * @var ActiveForm: $form  * @var string $requestType  * @var bool $directPopulating  *\/  \/\/ \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e safe \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c if (($safeAttributes = $filterModel-&gt;safeAttributes())) {     echo Html::beginTag('div', ['class' =&gt; 'well']);     $form = ActiveForm::begin([             'method' =&gt; $requestType         ]);     foreach ($safeAttributes as $attribute) {         echo $form-&gt;field($filterModel, $attribute)-&gt;textInput([                 'name' =&gt; (!$directPopulating) ? $attribute : null             ]);     }     echo Html::submitInput('search', ['class' =&gt; 'btn btn-default']).         Html::endTag('div');     ActiveForm::end(); }   echo \\yii\\grid\\GridView::widget([         'dataProvider' =&gt; $dataProvider,         'filterModel' =&gt; $filterModel     ]); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e <a href=\"https:\/\/github.com\/yiisoft\/yii2\/blob\/master\/docs\/guide\/model.md#scenarios\">\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c<\/a> \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 GridView. \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u043b\u0438 \u0436\u0435 \u0443 \u043d\u0438\u0445 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438. <\/p>\n<h5>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430<\/h5>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 ListAction. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0431\u0430\u0437\u0443 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 ListAction-\u0430. \u041b\u043e\u0433\u0438\u043a\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  namespace app\\modules\\shop\\components;  use yii\\base\\Model; use yii\\data\\DataProviderInterface;  abstract class FilterModelBase extends Model {     \/**      * @var DataProviderInterface      *\/     protected $_dataProvider;      \/**      * @return DataProviderInterface      *\/     abstract public function search();      \/**      * \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0438      * \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0447\u0430\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043e\u0431\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u043e\u0434-\u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043f\u043e \u0434\u0430\u0442\u0430\u043c \u0438 \u0442.\u0434.      * @return mixed      *\/     public function buildModels()     {         return $this-&gt;_dataProvider-&gt;getModels();     }      public function getDataProvider()     {         return $this-&gt;_dataProvider;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c ListAction \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u0412 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u200a\u2014\u200a\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f, \u043b\u043e\u0433\u0438\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0442.\u043f.<\/p>\n<p>  \u041b\u043e\u0433\u0438\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 buildModels.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  namespace app\\modules\\shop\\models\\search;  use app\\modules\\shop; use yii\\data\\ActiveDataProvider; use yii\\data\\Pagination;  class ProductSearch extends shop\\components\\FilterModelBase {     \/**      * \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435      *\/     public $price;     public $page_size = 20;      \/**      * \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438      * @return array      *\/     public function rules()     {         return [             \/\/ \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435             ['price', 'required'],             \/\/ \u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u043b\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u043e\u043b\u0436\u043d\u0430 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0435             ['page_size', 'integer', 'integerOnly' =&gt; true, 'min' =&gt; 1]         ];     }      \/**      * \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438      * @return ActiveDataProvider|\\yii\\data\\DataProviderInterface      *\/     public function search()     {         \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c\u0438         $query = shop\\models\\Product::find()             -&gt;with('categories');          \/**          * \u0421\u043e\u0437\u0434\u0430\u0451\u043c DataProvider, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e          *\/         $this-&gt;_dataProvider = new ActiveDataProvider([             'query' =&gt; $query,             'pagination' =&gt; new Pagination([                     'pageSize' =&gt; $this-&gt;page_size                 ])         ]);          \/\/ \u0415\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442, \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043f\u043e \u0446\u0435\u043d\u0435         if ($this-&gt;validate()) {             $query-&gt;where('price &lt;= :price', [':price' =&gt; $this-&gt;price]);         }          return $this-&gt;_dataProvider;     }      \/**      * \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439,      * \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438      * \u042d\u0442\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.      * @return array|mixed      *\/     public function buildModels()     {         $result = [];          \/**          * @var shop\\models\\Product $product          *\/         foreach ($this-&gt;_dataProvider-&gt;getModels() as $product) {             $result[] = array_merge($product-&gt;getAttributes(), [                     'categories' =&gt; $product-&gt;categories                 ]);         }          return $result;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c ListAction \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  namespace app\\modules\\shop\\controllers;  use yii\\web\\Controller; use app\\modules\\shop\\actions\\ListAction; use app\\modules\\shop\\models\\search\\ProductSearch;  class ProductController extends Controller {     public function actions()     {         return [             'index' =&gt; [                 'class' =&gt; ListAction::className(),                 'filterModel' =&gt; new ProductSearch(),                 'directPopulating' =&gt; false,             ]         ];     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a action-\u0443 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c Ajax \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c JSON \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0431\u043e\u0440\u043a\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>{     &quot;list&quot;:         [             {                 &quot;id&quot;: &quot;7&quot;,                 &quot;price&quot;: &quot;50&quot;,                 &quot;title&quot;: &quot;product title #7&quot;,                 &quot;description&quot;: &quot;product description #7&quot;,                 &quot;create_time&quot;: &quot;0&quot;,                 &quot;update_time&quot;: &quot;0&quot;,                 &quot;categories&quot;:                     [                         {                             &quot;id&quot;: &quot;1&quot;,                             &quot;title&quot;: &quot;category title #1&quot;,                             &quot;description&quot;: &quot;category description #1&quot;,                             &quot;create_time&quot;: &quot;0&quot;,                             &quot;update_time&quot;: &quot;0&quot;                         }                     ]             }         ],     &quot;pagination&quot;:     {         &quot;pageVar&quot;: &quot;page&quot;,         &quot;forcePageVar&quot;: true,         &quot;route&quot;: null,         &quot;params&quot;: null,         &quot;urlManager&quot;: null,         &quot;validatePage&quot;: true,         &quot;pageSize&quot;: 20,         &quot;totalCount&quot;: 1     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u041f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 (\u043d\u0435 Ajax) \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u043e\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/b75\/413\/24e\/b7541324ec26c2ca5fb29a05e554b10a.png\"\/><\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 <a href=\"https:\/\/github.com\/ZhandosKz\/list-action-example\">\u043c\u043e\u0434\u0443\u043b\u044c<\/a> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/packagist.org\/packages\/yiisoft\/yii2-app-basic\">basic application template<\/a>. \u0415\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Yii2 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<pre><code class=\"bash\">php yii migrate --migrationPath=modules\/shop\/migrations <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u044f \u0432\u0441\u0451 \u0432\u044b\u0448\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.\u00a0<\/p>\n<p>  \u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 API, \u043e\u0434\u0438\u043d action \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 JSON \u0438\u043b\u0438 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.    \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\/company\/topic\/blog\/208556\/\"> http:\/\/habrahabr.ru\/company\/topic\/blog\/208556\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c, \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u0437\u0430\u043d\u0443\u0434\u043d\u043e. \u041a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 Standalone actions \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.  <\/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-208556","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208556","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=208556"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208556\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}