class AuthItemChild extends \yii\db\ActiveRecord
{
}
class AuthItem extends \yii\db\ActiveRecord
{
public function getChildItems()
{
return $this->hasMany(AuthItem::className(), ['name' => 'child'])->viaTable(AuthItemChild::className(), ['parent'=>'name']);
}
}
$item = AuthItem::findOne(['name'=>'FIRST2']);
$childItems = $item->childItems();
php -r "readfile('https://getcomposer.org/installer');" | php # скачали composer
php composer.phar require "yiisoft/yii:@stable" # подключили yii1
php composer.phar require "phpoffice/phpexcel:@stable" # подключили phpexcel
require_once(__DIR__.'/../vendor/yiisoft/yii/framework/yii.php');
require_once(__DIR__.'/../vendor/autoload.php');
$config= require(__DIR__.'/../config/web.php');
Yii::createWebApplication($config)->run();
history.pushState(null, null, location.href);
window.onpopstate = function(event) {
history.go(1);
};
var $form = $('form'),
$data = $form.data('yiiActiveForm');
data.settings.validationUrl = 'новый урл';
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]) ?>
$this->render('create', ['model'=>$model]);
$this->renderPartial('application.views.review.create');
$this->renderPartial('application.views.review.create', ['model'=>$model]);
[
'modules' => [
'api' => [
'class' => 'common\modules\api\Module',
],
],
]
select object.name, inbox.sms from object
inner join inbox on inbox.number = object.number
inner join objects_user on objects_user.id_object = object.id
inner join user on user.id = objects_user.id_user
where user.id = :id_user