{"id":216475,"date":"2014-04-01T08:04:02","date_gmt":"2014-04-01T04:04:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=216475"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=216475","title":{"rendered":"<span class=\"post_title\">REST \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Yii<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412\u0441\u0435, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Yii framework \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u043d\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 ORM \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 ActiveRecord. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445. \u042d\u0442\u043e \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f FTP \u0438 Radius \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0433\u0434\u0435 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0435\u0439 \u0444\u0438\u043b\u0438\u0430\u043b\u044b \u0441 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0444\u0438\u0441\u043e\u043c.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e. \u041d\u0435\u0434\u043e\u043b\u0433\u0438\u0435 \u0440\u0430\u0437\u0434\u0443\u043c\u044c\u044f \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b HTTP \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043d\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434 <a href=\"http:\/\/habrahabr.ru\/post\/144011\/\">REST<\/a>. \u041f\u0440\u0438\u0447\u0438\u043d \u0431\u044b\u043b\u043e \u0434\u0432\u0435, \u043f\u0435\u0440\u0432\u0430\u044f \u0438 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u2014 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e, \u0442\u0430\u043a \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 REST. \u0412\u0442\u043e\u0440\u0430\u044f \u2014 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f HTTP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0430 \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u043e\u0442\u043a\u0440\u044b\u0442 \u043d\u0430 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 firewall-\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c proxy \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  \u0427\u0430\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0442\u0435\u043b\u043e \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u043e.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u043e. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u043a\u0430. \u041e\u0431\u044b\u0447\u043d\u043e REST API \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u043d\u0435 \u0441\u0430\u0439\u0442\u0430\u043c\u0438. \u0412\u044b\u0445\u043e\u0434\u0438\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0435\u043b\u0430\u0435\u0442 HTTP \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043c\u043e\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430\u043c\u0438, \u0430 web \u0441\u0435\u0440\u0432\u0435\u0440, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 HTTP \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u0430\u043b\u044c\u0448\u0435, \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u0434\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d REST API \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043c\u0438.<\/p>\n<h5>\u0421\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h5>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/www.yiiframework.com\/extension\/restfullyii\/\">restfullyii<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e \u044f \u0443\u0447\u0443\u0441\u044c \u0438 \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437\u043d\u0443\u0442\u0440\u0438. \u0410 \u043f\u043e\u0442\u043e\u043c\u0443 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0443\u043d\u0434\u0435\u0440\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430.<\/p>\n<p>  \u041a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"http:\/\/www.yiiframework.com\/wiki\/175\/how-to-create-a-rest-api\/\">\u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c wiki \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u0437\u044f\u0442\u043e \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443. \u0427\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c, \u0442\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0433\u0434\u0430 \u0432 action-\u0430\u0445 \u043c\u043e\u0434\u0435\u043b\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0432 switch \u0431\u043b\u043e\u043a\u0435. \u042d\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 action-\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"php\">  if (isset($_GET['model']))       $_model = CActiveRecord::model(ucfirst($_GET['model'])); <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u043e\u043b\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 (\u044f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0443\u0431\u0440\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0432\u044b\u0448\u0435 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0433\u043b\u0430\u0432\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 Yii \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f):<\/p>\n<pre><code class=\"php\">&lt;?php  class ApiController extends Controller {     Const APPLICATION_ID = 'ASCCPE';      private $format = 'json';      public function filters()     {         return array();     }      public function actionList()     {         if (isset($_GET['model']))             $_model = CActiveRecord::model(ucfirst($_GET['model']));          if (isset($_model))         {             $_data = $_model-&gt;summary($_GET)-&gt;findAll();              if (empty($_data))                 $this-&gt;_sendResponse(200, sprintf('No items were found for model &lt;b&gt;%s&lt;\/b&gt;', $_GET['model']));             else             {                 $_rows = array();                  foreach ($_data as $_d)                     $_rows[] = $_d-&gt;attributes;                  $this-&gt;_sendResponse(200, CJSON::encode($_rows));             }         }         else         {             $this-&gt;_sendResponse(501, sprintf(                 'Error: Mode &lt;b&gt;list&lt;\/b&gt; is not implemented for model &lt;b&gt;%s&lt;\/b&gt;',                 $_GET['model']));             Yii::app()-&gt;end();         }     }      public function actionView()     {         if (isset($_GET['model']))             $_model = CActiveRecord::model(ucfirst($_GET['model']));          if (isset($_model))         {             $_data = $_model-&gt;findByPk($_GET['id']);              if (empty($_data))                 $this-&gt;_sendResponse(200, sprintf('No items were found for model &lt;b&gt;%s&lt;\/b&gt;', $_GET['model']));             else                 $this-&gt;_sendResponse(200, CJSON::encode($_data));         }         else         {             $this-&gt;_sendResponse(501, sprintf(                 'Error: Mode &lt;b&gt;list&lt;\/b&gt; is not implemented for model &lt;b&gt;%s&lt;\/b&gt;',                 $_GET['model']));             Yii::app()-&gt;end();         }     }      public function actionCreate()     {         $post = Yii::app()-&gt;request-&gt;rawBody;          if (isset($_GET['model']))         {             $_modelName = ucfirst($_GET['model']);             $_model = new $_modelName;         }          if (isset($_model))         {             if (!empty($post))             {                 $_data = CJSON::decode($post, true);                  foreach($_data as $var =&gt; $value)                     $_model-&gt;$var = $value;                  if($_model-&gt;save())                     $this-&gt;_sendResponse(200, CJSON::encode($_model));                 else                 {                     \/\/ Errors occurred                     $msg = &quot;&lt;h1&gt;Error&lt;\/h1&gt;&quot;;                     $msg .= sprintf(&quot;Couldn't create model &lt;b&gt;%s&lt;\/b&gt;&quot;, $_GET['model']);                     $msg .= &quot;&lt;ul&gt;&quot;;                     foreach($_model-&gt;errors as $attribute =&gt; $attr_errors)                     {                         $msg .= &quot;&lt;li&gt;Attribute: $attribute&lt;\/li&gt;&quot;;                         $msg .= &quot;&lt;ul&gt;&quot;;                         foreach($attr_errors as $attr_error)                             $msg .= &quot;&lt;li&gt;$attr_error&lt;\/li&gt;&quot;;                         $msg .= &quot;&lt;\/ul&gt;&quot;;                     }                     $msg .= &quot;&lt;\/ul&gt;&quot;;                     $this-&gt;_sendResponse(500, $msg);                 }             }         }         else         {             $this-&gt;_sendResponse(501, sprintf(                 'Error: Mode &lt;b&gt;create&lt;\/b&gt; is not implemented for model &lt;b&gt;%s&lt;\/b&gt;',                 $_GET['model']));             Yii::app()-&gt;end();         }     }      public function actionUpdate()     {         $post = Yii::app()-&gt;request-&gt;rawBody;          if (isset($_GET['model']))         {             $_model = CActiveRecord::model(ucfirst($_GET['model']))-&gt;findByPk($_GET['id']);             $_model-&gt;scenario = 'update';         }          if (isset($_model))         {             if (!empty($post))             {                 $_data = CJSON::decode($post, true);                  foreach($_data as $var =&gt; $value)                     $_model-&gt;$var = $value;                  if($_model-&gt;save())                 {                     Yii::log('API update -&gt; '.$post, 'info');                     $this-&gt;_sendResponse(200, CJSON::encode($_model));                 }                 else                 {                     \/\/ Errors occurred                     $msg = &quot;&lt;h1&gt;Error&lt;\/h1&gt;&quot;;                     $msg .= sprintf(&quot;Couldn't update model &lt;b&gt;%s&lt;\/b&gt;&quot;, $_GET['model']);                     $msg .= &quot;&lt;ul&gt;&quot;;                     foreach($_model-&gt;errors as $attribute =&gt; $attr_errors)                     {                         $msg .= &quot;&lt;li&gt;Attribute: $attribute&lt;\/li&gt;&quot;;                         $msg .= &quot;&lt;ul&gt;&quot;;                         foreach($attr_errors as $attr_error)                             $msg .= &quot;&lt;li&gt;$attr_error&lt;\/li&gt;&quot;;                         $msg .= &quot;&lt;\/ul&gt;&quot;;                     }                     $msg .= &quot;&lt;\/ul&gt;&quot;;                      $this-&gt;_sendResponse(500, $msg);                 }             }             else                 Yii::log('POST data is empty');         }         else         {             $this-&gt;_sendResponse(501, sprintf(                 'Error: Mode &lt;b&gt;update&lt;\/b&gt; is not implemented for model &lt;b&gt;%s&lt;\/b&gt;',                 $_GET['model']));             Yii::app()-&gt;end();         }     }      public function actionDelete()     {         if (isset($_GET['model']))             $_model = CActiveRecord::model(ucfirst($_GET['model']));          if (isset($_model))         {             $_data = $_model-&gt;findByPk($_GET['id']);              if (!empty($_data))             {                 $num = $_data-&gt;delete();                  if($num &gt; 0)                     $this-&gt;_sendResponse(200, $num);    \/\/this is the only way to work with backbone                 else                     $this-&gt;_sendResponse(500, sprintf(&quot;Error: Couldn't delete model &lt;b&gt;%s&lt;\/b&gt; with ID &lt;b&gt;%s&lt;\/b&gt;.&quot;, $_GET['model'], $_GET['id']) );             }             else                 $this-&gt;_sendResponse(400, sprintf(&quot;Error: Didn't find any model &lt;b&gt;%s&lt;\/b&gt; with ID &lt;b&gt;%s&lt;\/b&gt;.&quot;, $_GET['model'], $_GET['id']));         }         else         {             $this-&gt;_sendResponse(501, sprintf('Error: Mode &lt;b&gt;delete&lt;\/b&gt; is not implemented for model &lt;b&gt;%s&lt;\/b&gt;', ucfirst($_GET['model'])));             Yii::app()-&gt;end();         }     }      private function _sendResponse($status = 200, $body = '', $content_type = 'text\/html')     {         ...     }      private function _getStatusCodeMessage($status)     {         ...     }      private function _checkAuth()     {         ...     } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432 <b>ActiveRecord<\/b> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f-\u043c\u0430\u0441\u0441\u0438\u0432 <b>attributes<\/b> \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043f\u043e\u043b\u044f \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b <b>getAttributes<\/b> \u0438, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, <b>hasAttribute<\/b>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <b>getAttributes<\/b>:<\/p>\n<pre><code class=\"php\">    public function getAttributes($names = true)     {            $_attrs = parent::getAttributes($names);          $_attrs['quota_limit'] = $this-&gt;limit['bytes_in_avail'];         $_attrs['quota_used'] = $this-&gt;tally['bytes_in_used'];          return $_attrs;     } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c named scope <b>summary<\/b> \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.:<\/p>\n<pre><code class=\"php\">    public function summary($_getvars = null)     {         $_criteria = new CDbCriteria();          if (isset($_getvars['count']))         {             $_criteria-&gt;limit = $_getvars['count'];             if (isset($_getvars['page']))                 $_criteria-&gt;offset = ($_getvars['page']) * $_getvars['count'];         }          if (isset($_getvars['sort']))             $_criteria-&gt;order = str_replace('.', ' ', $_getvars['sort']);          $this-&gt;getDbCriteria()-&gt;mergeWith($_criteria);          return $this;     } <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"php\">&lt;?php  \/**  * This is the model class for table &quot;ftpuser&quot;.  *  * The followings are the available columns in table 'ftpuser':  * @property string $id  * @property string $userid  * @property string $passwd  * @property integer $uid  * @property integer $gid  * @property string $homedir  * @property string $shell  * @property integer $count  * @property string $accessed  * @property string $modified  *\/ class Ftpuser extends CActiveRecord {     \/\/ Additional quota parameters     public $quota_limit;     public $quota_used;  \t\/** \t * Returns the static model of the specified AR class. \t * @return ftpuser the static model class \t *\/ \tpublic static function model($className=__CLASS__) \t{ \t\treturn parent::model($className); \t}  \t\/** \t * @return string the associated database table name \t *\/ \tpublic function tableName() \t{ \t\treturn 'ftpuser'; \t}  \t\/** \t * @return array validation rules for model attributes. \t *\/ \tpublic function rules() \t{ \t\t\/\/ NOTE: you should only define rules for those attributes that \t\t\/\/ will receive user inputs. \t\treturn array( \t\t\tarray('uid, gid, count', 'numerical', 'integerOnly' =&gt; true),             array('userid, passwd, homedir', 'required'), \t\t\tarray('userid, passwd', 'length', 'max' =&gt; 32), \t\t\tarray('homedir', 'length', 'max' =&gt; 255), \t\t\tarray('shell', 'length', 'max' =&gt; 16), \t\t\tarray('accessed, modified, quota_limit, quota_used', 'safe'),             \/\/array('userid', 'unique'), \t\t\t\/\/ The following rule is used by search(). \t\t\t\/\/ Please remove those attributes that should not be searched. \t\t\tarray('id, userid, passwd, uid, gid, homedir, shell, count, accessed, modified', 'safe', 'on' =&gt; 'search'), \t\t); \t}  \t\/** \t * @return array relational rules. \t *\/ \tpublic function relations() \t{ \t\t\/\/ NOTE: you may need to adjust the relation name and the related \t\t\/\/ class name for the relations automatically generated below. \t\treturn array(             'limit' =&gt; array(self::HAS_ONE, 'FTPQuotaLimits', 'user_id'),             'tally' =&gt; array(self::HAS_ONE, 'FTPQuotaTallies', 'user_id'), \t\t); \t}  \t\/** \t * @return array customized attribute labels (name=&gt;label) \t *\/ \tpublic function attributeLabels() \t{ \t\treturn array( \t\t\t'id' =&gt; 'Id', \t\t\t'userid' =&gt; 'Userid', \t\t\t'passwd' =&gt; 'Passwd', \t\t\t'uid' =&gt; 'Uid', \t\t\t'gid' =&gt; 'Gid', \t\t\t'homedir' =&gt; 'Homedir', \t\t\t'shell' =&gt; 'Shell', \t\t\t'count' =&gt; 'Count', \t\t\t'accessed' =&gt; 'Accessed', \t\t\t'modified' =&gt; 'Modified', \t\t); \t}  \t\/** \t * Retrieves a list of models based on the current search\/filter conditions. \t * @return CActiveDataProvider the data provider that can return the models based on the search\/filter conditions. \t *\/ \tpublic function search() \t{ \t\t\/\/ Warning: Please modify the following code to remove attributes that \t\t\/\/ should not be searched.  \t\t$criteria = new CDbCriteria;  \t\t$criteria-&gt;compare('userid', $this-&gt;userid, true); \t\t$criteria-&gt;compare('homedir', $this-&gt;homedir, true);  \t\treturn new CActiveDataProvider('ftpuser', array( \t\t\t'criteria' =&gt; $criteria, \t\t)); \t}      public function summary($_getvars = null)     {         $_criteria = new CDbCriteria();          if (isset($_getvars['count']))         {             $_criteria-&gt;limit = $_getvars['count'];             if (isset($_getvars['page']))                 $_criteria-&gt;offset = ($_getvars['page']) * $_getvars['count'];         }          if (isset($_getvars['sort']))             $_criteria-&gt;order = str_replace('.', ' ', $_getvars['sort']);          $this-&gt;getDbCriteria()-&gt;mergeWith($_criteria);          return $this;     }      public function getAttributes($names = true)     {         $_attrs = parent::getAttributes($names);          $_attrs['quota_limit'] = $this-&gt;limit['bytes_in_avail'];         $_attrs['quota_used'] = $this-&gt;tally['bytes_in_used'];          return $_attrs;     }      protected function afterFind()     {         parent::afterFind();          $this-&gt;quota_limit = $this-&gt;limit['bytes_in_avail'];         $this-&gt;quota_used = $this-&gt;tally['bytes_in_used'];     }      protected function afterSave()     {         parent::afterSave();          if ($this-&gt;isNewRecord && !empty($this-&gt;quota_limit))         {             $_quota = new FTPQuotaLimits();              $_quota-&gt;user_id = $this-&gt;id;             $_quota-&gt;name = $this-&gt;userid;             $_quota-&gt;bytes_in_avail = $this-&gt;quota_limit;              $_quota-&gt;save();         }     }      protected function beforeValidate()     {         if ($this-&gt;isNewRecord)         {             if (empty($this-&gt;passwd))                 $this-&gt;passwd = $this-&gt;genPassword();              $this-&gt;homedir = Yii::app()-&gt;params['baseFTPDir'].$this-&gt;userid;         }         elseif ($this-&gt;scenario == 'update')         {             if (empty($this-&gt;quota_limit))             {                 FTPQuotaLimits::model()-&gt;deleteAllByAttributes(array('name' =&gt; $this-&gt;userid));                 FTPQuotaTallies::model()-&gt;deleteAllByAttributes(array('name' =&gt; $this-&gt;userid));             }             else             {                 $_quota_limit = FTPQuotaLimits::model()-&gt;find('name = :name', array(':name' =&gt; $this-&gt;userid));                  if (isset($_quota_limit))                 {                     $_quota_limit-&gt;bytes_in_avail = $this-&gt;quota_limit;                     $_quota_limit-&gt;save();                 }                 else                 {                     $_quota_limit = new FTPQuotaLimits();                      $_quota_limit-&gt;name = $this-&gt;userid;                     $_quota_limit-&gt;user_id = $this-&gt;id;                     $_quota_limit-&gt;bytes_in_avail = $this-&gt;quota_limit;                      $_quota_limit-&gt;save();                 }             }         }          return parent::beforeValidate();     }      protected function beforeDelete()     {         FTPQuotaLimits::model()-&gt;deleteAllByAttributes(array('name' =&gt; $this-&gt;userid));         FTPQuotaTallies::model()-&gt;deleteAllByAttributes(array('name' =&gt; $this-&gt;userid));          return parent::beforeDelete();     }      private function genPassword($len = 6)     {         $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';         $count = mb_strlen($chars);          for ($i = 0, $result = ''; $i &lt; $len; $i++)         {             $index = rand(0, $count - 1);             $result .= mb_substr($chars, $index, 1);         }          return $result;     } } <\/code><\/pre>\n<p>  \u0427\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0441\u0447\u0430\u0441\u0442\u044c\u044f \u2014 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u0438\u0434\u0430 <b>\/users\/156\/records<\/b>, \u043d\u043e \u043d\u0430 \u0442\u043e \u044d\u0442\u043e framework, \u0430 \u043d\u0435 CMS, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u2014 \u0434\u043e\u043f\u0438\u043b\u0438 \u0441\u0430\u043c. \u041c\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0442\u0430\u043a\u043e\u0435 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0421 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u043e\u043a\u043e\u043d\u0447\u0438\u043b\u0438, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439. \u0414\u043b\u044f \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u043f\u043e\u043b\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 Yii \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 <a href=\"http:\/\/files.mail.ru\/5FD9CE41E2484F1B93F499C2CED26BC5\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041d\u0435 \u0437\u043d\u0430\u044e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0436\u0438\u0432\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0434\u0430 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u0435\u0439 \u2014 \u043f\u0440\u043e\u0448\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h5>\u041a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h5>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <a href=\"https:\/\/github.com\/Haensel\/ActiveResource\">ActiveResource<\/a>. \u041a\u0430\u043a \u043f\u0438\u0448\u0435\u0442 \u0430\u0432\u0442\u043e\u0440, \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <b>ActiveResource<\/b> \u0432 Ruby on Rails. \u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0435\u0441\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0441 <b>ActiveRecord<\/b>, \u043d\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u0445 Yii <b>GridView<\/b> \u0438\u043b\u0438 <b>ListView<\/b> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 <b>ActiveDataProvider<\/b>. \u0411\u0435\u0433\u043b\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0432\u044b\u0432\u0435\u043b \u043c\u0435\u043d\u044f \u043d\u0430 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0435 \u0432 <a href=\"https:\/\/github.com\/Haensel\/ActiveResource\/tree\/QueryCriteria\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443<\/a> \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 <b>EActiveResourceDataProvider<\/b> \u0438 <b>EActiveResourceQueryCriteria<\/b>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0438\u0445 \u0432 <a href=\"http:\/\/www.yiiframework.com\/forum\/index.php\/topic\/21192-activeresource-for-yii\/page__st__20\">\u0432\u0435\u0442\u043a\u0435 \u0444\u043e\u0440\u0443\u043c\u0430<\/a> \u0433\u0434\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0441\u0430\u043c \u0430\u0432\u0442\u043e\u0440 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. <a href=\"http:\/\/www.yiiframework.com\/forum\/index.php\/topic\/21192-activeresource-for-yii\/page__view__findpost__p__192528\">\u0422\u0430\u043c \u0436\u0435 \u0431\u044b\u043b\u0438<\/a> \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 <b>ESort<\/b> \u0438 <b>EActiveResourceDataProvider<\/b>.<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u0441\u0435 \u0438\u0437\u044f\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043d\u0430\u043f\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 pagination \u0432 grid-\u0435. \u0411\u0435\u0433\u043b\u043e\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e, \u0447\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 offset \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0435 \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a pagination \u0432 <b>GridView<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 10 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 2 \u043d\u0430\u0441 \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043b\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 20. \u0417\u0430\u043b\u0435\u0437\u0430\u0435\u043c \u0432 \u043a\u043e\u0434 \u0438 \u043f\u0440\u0430\u0432\u0438\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <i>protected\/extensions\/EActiveResource\/EActiveResourceQueryCriteria.php<\/i> \u0432 \u0442\u0435\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <b>buildQueryString<\/b> \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u0430\u0432\u043a\u0443:<\/p>\n<pre><code class=\"php\">if($this-&gt;offset&gt;0)     \/\/ array_push($parameters, $this-&gt;offsetKey.'='.$this-&gt;offset);     array_push($parameters, $this-&gt;offsetKey.'='.$this-&gt;offset \/ $this-&gt;limit); <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 <b>getOffset<\/b> \u0438\u0437 <b>EActiveResourcePagination<\/b> \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u0443\u044e.<\/p>\n<p>  \u0418\u0442\u0430\u043a \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e REST \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 GII \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 REST API \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0430\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0430\u0441\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c <b>ActiveResource<\/b> \u043f\u0440\u044f\u043c\u043e \u043e\u0442\u0442\u0443\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043c\u043a\u0430 \u0441 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c <b>getConnection<\/b> (\u044d\u0442\u043e \u043c\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441 FTP \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e FTPServers):<\/p>\n<pre><code class=\"php\">abstract class EActiveResourceSelect extends EActiveResource {     \/**      * Returns the EactiveResourceConnection used to talk to the service.      * @return EActiveResourceConnection The connection component as pecified in the config      *\/     public function getConnection()     {         $_server_id = Yii::app()-&gt;session['ftp_server_id'];         $_db_params = array();          if (isset($_server_id))         {             $_srv = FTPServers::model()-&gt;findByPk($_server_id);              if (isset($_srv))                 $_db_params = $_srv-&gt;attributes;             else                 Yii::log('info', &quot;No FTP server with ID: $_server_id were found&quot;);         }         else         {             $_srv = FTPServers::model()-&gt;find();              if (isset($_srv))             {                 $_db_params = $_srv-&gt;attributes;                 Yii::app()-&gt;session['ftp_server_id'] = $_srv-&gt;id;             }             else                 Yii::log(&quot;No FTP servers were found&quot;, CLogger::LEVEL_INFO);         }          self::$_connection = new EActiveResourceConnection();         self::$_connection-&gt;init();         self::$_connection-&gt;site = $_db_params['site'];         self::$_connection-&gt;acceptType = $_db_params['acceptType'];         self::$_connection-&gt;contentType = $_db_params['contentType'];          if (isset($_db_params['username']) && isset($_db_params['password']))         {             self::$_connection-&gt;auth = array(                 'type' =&gt; 'basic',                 'username' =&gt; $_db_params['username'],                 'password' =&gt; $_db_params['password'],             );         }          return self::$_connection;     } } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0438\u0447\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u0430\u0441\u044c \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u0433\u043e <b>ActiveRecord<\/b> \u0432 \u0447\u0435\u043c, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <b>ActiveResource<\/b>.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430.    \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\/216475\/\"> http:\/\/habrahabr.ru\/post\/216475\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412\u0441\u0435, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Yii framework \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u043d\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 ORM \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 ActiveRecord. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445. \u042d\u0442\u043e \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f FTP \u0438 Radius \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0433\u0434\u0435 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0435\u0439 \u0444\u0438\u043b\u0438\u0430\u043b\u044b \u0441 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0444\u0438\u0441\u043e\u043c.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e. \u041d\u0435\u0434\u043e\u043b\u0433\u0438\u0435 \u0440\u0430\u0437\u0434\u0443\u043c\u044c\u044f \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b HTTP \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043d\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434 <a href=\"http:\/\/habrahabr.ru\/post\/144011\/\">REST<\/a>. \u041f\u0440\u0438\u0447\u0438\u043d \u0431\u044b\u043b\u043e \u0434\u0432\u0435, \u043f\u0435\u0440\u0432\u0430\u044f \u0438 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u2014 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e, \u0442\u0430\u043a \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 REST. \u0412\u0442\u043e\u0440\u0430\u044f \u2014 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f HTTP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0430 \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u043e\u0442\u043a\u0440\u044b\u0442 \u043d\u0430 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 firewall-\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c proxy \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  \u0427\u0430\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0442\u0435\u043b\u043e \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u043e.  <\/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-216475","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/216475","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=216475"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/216475\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=216475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=216475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=216475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}