{"id":173153,"date":"2013-03-19T19:20:04","date_gmt":"2013-03-19T15:20:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=173153"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=173153","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f Yii<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0435\u0447\u0435\u0440\u0430, \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0444\u043e\u0440\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u0434\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yii. \u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u0430 \u0442\u043e\u0447\u043d\u0435\u0435, \u043c\u043e\u0434\u0435\u043b\u044c \u0444\u043e\u0440\u043c\u044b) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c config-\u0444\u0430\u0439\u043b\u044b \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u0432\u0435\u0431\u0430. \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u0432\u0435\u044f\u043d\u0430 \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u043c <a href=\"http:\/\/habrahabr.ru\/post\/172737\">\u043f\u043e\u0441\u0442\u043e\u043c<\/a> \u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u043d\u0430 \u0411\u0414. \u042d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u044d\u0439\u0442\u0438\u0432\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 Yii. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0437\u0430 \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043a \u0431\u0430\u0437\u0435\/\u043a\u044d\u0448\u0443, \u0430 \u0438\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u043e\u0441\u0442\u044c\u044e \u043d\u0443\u0436\u043d\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c.<\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0418\u0434\u0435\u044f<\/h4>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 Yii \u2014 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 php \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432.<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"php\">return array(     'name' =&gt; 'My Awesome Web Site',     'lang' =&gt; 'ru',     'sourceLang' =&gt; 'en', ); <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0440\u043e\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0430\u0439\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0437 \u0432 \u0433\u043e\u0434 \u0438\u043b\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0432\u0441\u0435. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c E-mail \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u044f\u0434\u043e\u043c \u0441 \u043b\u043e\u0433\u043e\u0442\u0438\u043f\u043e\u043c. \u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u0441\u0430\u0439\u0442\u0430, \u043d\u043e \u043d\u0435 \u0434\u0430\u0432\u0430\u0442\u044c \u0436\u0435 \u0435\u043c\u0443 \u043b\u0435\u0437\u0442\u044c \u0432 \u043a\u043e\u0434, \u0432\u0435\u0440\u043d\u043e? (:<\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u0430. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0451 \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c.<\/p>\n<h5>\u041c\u043e\u0434\u0435\u043b\u044c<\/h5>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435. \u0410 \u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u0441\u0442\u044c \u0443 \u043a\u043e\u043d\u0444\u0438\u0433-\u0444\u0430\u0439\u043b\u043e\u0432? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0412\u043e\u0442 \u0434\u043b\u044f \u043d\u0435\u0433\u043e-\u0442\u043e \u043d\u0430\u043c \u0438 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<pre><code class=\"php\">class ConfigForm extends CFormModel { \t\/** @var array \u041c\u0430\u0441\u0441\u0438\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e *\/ \tprivate $_config = array();  \t\/** \t * \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \t * @param array $config \u041c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \t * @param string $scenario \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \t *\/ \tpublic function __construct($config = array(), $scenario = '') \t{ \t\tparent::__construct($scenario); \t\t$this-&gt;setConfig($config); \t}  \tpublic function setConfig($config) \t{ \t\t$this-&gt;_config = $config; \t}  \tpublic function getConfig() \t{ \t\treturn $this-&gt;_config; \t}  } <\/code><\/pre>\n<p>  \u041f\u043e\u043a\u0430 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438?<br \/>  <i>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043d\u0443\u0436\u0434\u044b \u0432 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 $_config, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0448\u043d\u0438\u043c \u0435\u0441\u043b\u0438 \u0412\u044b \u0432\u0434\u0440\u0443\u0433 \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0433\u0440\u044b<\/i><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0443\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u0412\u044b \u0432\u0435\u0434\u044c \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c (\u0445\u043e\u0442\u044f, \u0432\u0441\u0451 \u0436\u0435, \u0412\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043a\u043e\u0435-\u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435). \u0418\u0442\u0430\u043a, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432:  <\/p>\n<pre><code class=\"php\">array( \t'name' =&gt; 'My Awesome Site', \/\/ \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043c\u044f \u0441\u0430\u0439\u0442\u0430 - \u043f\u043b\u043e\u0445\u0430\u044f \u0438\u0434\u0435\u044f \t'params' =&gt; array( \t\t'adminEmail' =&gt; 'admin@example.com', \t\t'phoneNumber' =&gt; '555-555-555', \t\t'motto' =&gt; 'the best of the most awesome', \t), ); <\/code><\/pre>\n<p>  \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b: <b>name<\/b>, <b>params[adminEmail]<\/b>, <b>params[phoneNumber]<\/b>, <b>params[motto]<\/b>. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e, \u0438 \u0432\u043e\u0442 \u043c\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">\t\/** \t * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \t *  \t * @return array \t *\/ \tpublic function getAttributes() \t{ \t\t$this-&gt;attributesRecursive($this-&gt;_config, $output); \t\treturn $output; \t} \t\/** \t * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \t *  \t * @return array \t *\/ \tpublic function attributeNames() \t{ \t\t$this-&gt;attributesRecursive($this-&gt;_config, $output); \t\treturn array_keys($output); \t}  \t\/** \t * \u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \t * \t * @param array $config \t * @param array $output \t * @param string $name \t *\/ \tpublic function attributesRecursive($config, &$output = array(), $name = '') \t{ \t\tforeach ($config as $key =&gt; $attribute) { \t\t\tif ($name == '') \t\t\t\t$paramName = $key; \t\t\telse \t\t\t\t$paramName = $name . &quot;[{$key}]&quot;; \t\t\tif (is_array($attribute)) \t\t\t\t$this-&gt;attributesRecursive($attribute, $output, $paramName); \t\t\telse \t\t\t\t$output[$paramName] = $attribute; \t\t} \t} <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"php\">\tpublic function rules() \t{ \t\t$rules = array(); \t\t$attributes = array_keys($this-&gt;_config); \t\t$rules[] = array(implode(', ', $attributes), 'safe'); \t\treturn $rules; \t} <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432\u0438\u0434\u0430 <b>params[motto]<\/b> \u0441\u0447\u0438\u0442\u0430\u043b\u0438\u0441\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u043b\u0438\u0448\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442.<br \/>  <i>\u0421\u0442\u043e\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 params \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442. \u041c\u043e\u0433\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/i><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <b>$model-&gt;$attribute<\/b> \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b __set() \u0438 __get():  <\/p>\n<pre><code class=\"php\">\tpublic function __get($name) \t{ \t\t\/\/ \u0415\u0441\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 - \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 - \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u044d\u0441\u0442\u0430\u0444\u0435\u0442\u043d\u0443\u044e \u043f\u0430\u043b\u043e\u0447\u043a\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \t\tif (isset($this-&gt;_config[$name])) \t\t\treturn $this-&gt;_config[$name]; \t\telse \t\t\treturn parent::__get($name); \t}  \tpublic function __set($name, $value) \t{ \t\t\/\/ \u0415\u0441\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 - \u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \t\tif (isset($this-&gt;_config[$name])) \t\t\t$this-&gt;_config[$name] = $value; \t\telse \t\t\tparent::__set($name, $value); \t} <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435?<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u0430\u0440\u043a\u0430\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 \u0433\u043e\u0442\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043d\u0430 \u0443\u043c\u0435\u0435\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0443 \u043d\u0435\u0451 \u0435\u0441\u0442\u044c \u0438 \u043a\u0443\u0448\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438\u0437 \u0444\u043e\u0440\u043c\u044b. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 action \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 POST \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u044b:  <\/p>\n<pre><code class=\"php\">\tpublic function run() \t{ \t\t$path = YiiBase::getPathOfAlias('application.config') . '\/params.php'; \t\t$model = new ConfigForm(require($path)); \t\tif (isset($_POST['ConfigForm'])) { \t\t\t$model-&gt;setAttributes($_POST['ConfigForm']); \t\t\tif($model-&gt;save($path)) \t\t\t{ \t\t\t\tYii::app()-&gt;user-&gt;setFlash('success config', '\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430'); \t\t\t\t$this-&gt;controller-&gt;refresh(); \t\t\t} \t\t} \t\t$this-&gt;controller-&gt;render('config', compact('model')); \t} <\/code><\/pre>\n<p>  <i>\u042d\u0442\u043e\u0442 action \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0435\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u0443\u043b\u043e\u0432\u0438\u0442\u044c \u0441\u0443\u0442\u044c<\/i><\/p>\n<p>  \u0427\u0442\u043e-\u0442\u043e? \u041c\u0435\u0442\u043e\u0434\u0430 save() \u043d\u0435\u0442 \u0443 CFormModel? \u0412\u0435\u0440\u043d\u043e, \u043d\u043e \u043c\u044b \u0435\u0433\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u0444\u0430\u0439\u043b. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">\tpublic function save($path) \t{ \t\t$config = $this-&gt;generateConfigFile(); \t\t\/\/ \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \t\tif(!is_writable($path)) \t\t\tthrow new CException(&quot;Cannot write to config file!&quot;); \t\tfile_put_contents($path, $config, FILE_TEXT); \t\treturn true; \t}  \tpublic function generateConfigFile() \t{ \t\t$this-&gt;generateConfigFileRecursive($this-&gt;_config, $output); \t\t$output = preg_replace('#,$\\n#s', '', $output); \/\/ \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \t\treturn &quot;&lt;?php\\nreturn &quot; . $output . &quot;;\\n&quot;; \t}  \tpublic function generateConfigFileRecursive($attributes, &$output = &quot;&quot;, $depth = 1) \t{ \t\t$output .= &quot;array(\\n&quot;; \t\tforeach ($attributes as $attribute =&gt; $value) { \t\t\tif (!is_array($value)) \t\t\t\t$output .= str_repeat(&quot;\\t&quot;, $depth) . &quot;'&quot; . $this-&gt;escape($attribute) . &quot;' =&gt; '&quot; . $this-&gt;escape($value) . &quot;',\\n&quot;; \t\t\telse { \t\t\t\t$output .= str_repeat(&quot;\\t&quot;, $depth) . &quot;'&quot; . $this-&gt;escape($attribute) . &quot;' =&gt; &quot;; \t\t\t\t$this-&gt;generateConfigFileRecursive($value, $output, $depth + 1); \t\t\t} \t\t} \t\t$output .= str_repeat(&quot;\\t&quot;, $depth - 1) . &quot;),\\n&quot;; \/\/ \u0413\u043b\u0443\u0431\u0438\u043d\u0430 \u043d\u0443\u0436\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u043b\u0438\u043d\u0443 \u043e\u0442\u0441\u0442\u0443\u043f\u0430 \t}  \tprivate function escape($value) \t{ \t\t\/** \t\t * \u042d\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441 \u043a\u0430\u0432\u044b\u0447\u043a\u043e\u0439 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u043b\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 (php-injection). \t\t * \u041d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e, \u0447\u0442\u043e \u0432 php \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434,  \t\t * \u0437\u0430\u0442\u043e \u044f \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0437\u0430\u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \t\t*\/ \t\treturn str_replace(&quot;'&quot;, &quot;\\'&quot;, $value); \t} <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f View \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0444\u043e\u0440\u043c\u0430 \u0441\u0430\u043c\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c.  <\/p>\n<pre><code class=\"php\">&lt;?php $form = $this-&gt;beginWidget('CActiveForm', array( \t'id' =&gt; 'config-form', \t'enableAjaxValidation' =&gt; false, \/\/ Ajax- \u0438 Client- \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b, \u0442.\u043a. \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \t'enableClientValidation' =&gt; false, )); foreach ($model-&gt;attributeNames() as $attribute) { \techo CHtml::openTag('div', array('class' =&gt; 'row')); \t{ \t\techo $form-&gt;labelEx($model, $attribute); \t\techo $form-&gt;textField($model, $attribute); \t} \techo CHtml::closeTag('div'); } echo CHtml::submitButton('\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c'); $this-&gt;endWidget(); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0436\u0451\u0441\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0445 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.  <\/p>\n<pre><code class=\"php\">\tpublic function attributeLabels() \t{ \t\treturn array( \t\t\t'name' =&gt; '\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u0430', \t\t\t'params[adminEmail]' =&gt; 'Email \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430', \t\t\t'params[phoneNumber]' =&gt; '\u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430', \t\t\t'params[motto]' =&gt; '\u0414\u0435\u0432\u0438\u0437 \u0441\u0430\u0439\u0442\u0430', \t\t); \t} <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0438 \u0433\u0440\u0443\u0431\u043e, \u043e\u0434\u043d\u0430\u043a\u043e, \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u0438\u0445 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442 \u2014 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>  \u0412\u043e\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0438 \u0432\u0441\u0451. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0431\u0435\u0437 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">class ConfigForm extends CFormModel { \tprivate $_config = array();  \t\/** \t * \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \t * @param array $config \u041c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \t * @param string $scenario \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \t *\/ \tpublic function __construct($config = array(), $scenario = '') \t{ \t\tparent::__construct($scenario); \t\t$this-&gt;setConfig($config); \t}  \tpublic function setConfig($config) \t{ \t\t$this-&gt;_config = $config; \t}  \tpublic function getConfig() \t{ \t\treturn $this-&gt;_config; \t}  \tpublic function __get($name) \t{ \t\tif (isset($this-&gt;_config[$name])) \t\t\treturn $this-&gt;_config[$name]; \t\telse \t\t\treturn parent::__get($name); \t}  \tpublic function __set($name, $value) \t{ \t\tif (isset($this-&gt;_config[$name])) \t\t\t$this-&gt;_config[$name] = $value; \t\telse \t\t\tparent::__set($name, $value); \t}  \tpublic function save($path) \t{ \t\t$config = $this-&gt;generateConfigFile(); \t\tif(!is_writable($path)) \t\t\tthrow new CException(&quot;Cannot write to config file!&quot;); \t\tfile_put_contents($path, $config, FILE_TEXT); \t\treturn true; \t}  \tpublic function generateConfigFile() \t{ \t\t$this-&gt;generateConfigFileRecursive($this-&gt;_config, $output); \t\t$output = preg_replace('#,$\\n#s', '', $output); \t\treturn &quot;&lt;?php\\nreturn &quot; . $output . &quot;;\\n&quot;; \t}  \tpublic function generateConfigFileRecursive($attributes, &$output = &quot;&quot;, $depth = 1) \t{ \t\t$output .= &quot;array(\\n&quot;; \t\tforeach ($attributes as $attribute =&gt; $value) { \t\t\tif (!is_array($value)) \t\t\t\t$output .= str_repeat(&quot;\\t&quot;, $depth) . &quot;'&quot; . $this-&gt;escape($attribute) . &quot;' =&gt; '&quot; . $this-&gt;escape($value) . &quot;',\\n&quot;; \t\t\telse { \t\t\t\t$output .= str_repeat(&quot;\\t&quot;, $depth) . &quot;'&quot; . $this-&gt;escape($attribute) . &quot;' =&gt; &quot;; \t\t\t\t$this-&gt;generateConfigFileRecursive($value, $output, $depth + 1); \t\t\t} \t\t} \t\t$output .= str_repeat(&quot;\\t&quot;, $depth - 1) . &quot;),\\n&quot;; \t}  \tprivate function escape($value) \t{ \t\treturn str_replace(&quot;'&quot;, &quot;\\'&quot;, $value); \t}  \t\/** \t * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \t * \t * @return array \t *\/ \tpublic function getAttributes() \t{ \t\t$this-&gt;attributesRecursive($this-&gt;_config, $output); \t\treturn $output; \t}  \t\/** \t * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \t * \t * @return array \t *\/ \tpublic function attributeNames() \t{ \t\t$this-&gt;attributesRecursive($this-&gt;_config, $output); \t\treturn array_keys($output); \t}  \t\/** \t * \u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \t * \t * @param array $config \t * @param array $output \t * @param string $name \t *\/ \tpublic function attributesRecursive($config, &$output = array(), $name = '') \t{ \t\tforeach ($config as $key =&gt; $attribute) { \t\t\tif ($name == '') \t\t\t\t$paramName = $key; \t\t\telse \t\t\t\t$paramName = $name . &quot;[{$key}]&quot;; \t\t\tif (is_array($attribute)) \t\t\t\t$this-&gt;attributesRecursive($attribute, $output, $paramName); \t\t\telse \t\t\t\t$output[$paramName] = $attribute; \t\t} \t}  \tpublic function attributeLabels() \t{ \t\treturn array( \t\t\t'name' =&gt; '\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u0430', \t\t\t'params[adminEmail]' =&gt; 'Email \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430', \t\t\t'params[phoneNumber]' =&gt; '\u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430', \t\t\t'params[motto]' =&gt; '\u0414\u0435\u0432\u0438\u0437 \u0441\u0430\u0439\u0442\u0430', \t\t); \t}  \tpublic function rules() \t{ \t\t$rules = array(); \t\t$attributes = array_keys($this-&gt;_config); \t\t$rules[] = array(implode(', ', $attributes), 'safe'); \t\treturn $rules; \t}  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430\u0445 \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043d\u043e\u0448\u0443 \u0438\u0437\u0432\u0438\u043d\u0435\u043d\u0438\u044f \u0437\u0430 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u2014 \u0434\u0430\u0432\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u043e\u043c\u0435 \u043a\u043e\u0434\u0430 \u0432 \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u0430\u0445 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b    \t \t\t \t\t\t \t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043b\u0438 \u0412\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"173153\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"7573\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv39513\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"39513\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv39513\">\u0414\u0430<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv39515\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"39515\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv39515\">\u041d\u0435\u0442<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv39517\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"39517\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv39517\">\u0422\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0443<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<\/p><\/div>\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\/173153\/\"> http:\/\/habrahabr.ru\/post\/173153\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0435\u0447\u0435\u0440\u0430, \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0444\u043e\u0440\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u0434\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yii. \u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u0430 \u0442\u043e\u0447\u043d\u0435\u0435, \u043c\u043e\u0434\u0435\u043b\u044c \u0444\u043e\u0440\u043c\u044b) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c config-\u0444\u0430\u0439\u043b\u044b \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u0432\u0435\u0431\u0430. \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u0432\u0435\u044f\u043d\u0430 \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u043c <a href=\"http:\/\/habrahabr.ru\/post\/172737\">\u043f\u043e\u0441\u0442\u043e\u043c<\/a> \u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u043d\u0430 \u0411\u0414. \u042d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u044d\u0439\u0442\u0438\u0432\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 Yii. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0437\u0430 \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043a \u0431\u0430\u0437\u0435\/\u043a\u044d\u0448\u0443, \u0430 \u0438\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u043e\u0441\u0442\u044c\u044e \u043d\u0443\u0436\u043d\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c.<\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438.  <\/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-173153","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/173153","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=173153"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/173153\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=173153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=173153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=173153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}