'rules' => [
'news/<action>'=>'class1/<action>',
'pages/<action>'=>'class2/<action>',
'webs/<action>'=>'class3/<action>',
[
'pattern' => '<get1>/<get2>/<get3>/<get4>/<get5>',
'route' => 'site/index',
'defaults' => ['get1' => null, 'get2' => null, 'get3' => null, 'get4' => null, 'get5' => null],
],
],
public function actionLogin()
{
if (!Yii::$app->user->isGuest) return $this->goHome();
$model = new LoginForm();
return ($model->load(Yii::$app->request->post()) && $model->login()) ?
$this->redirect(['/zakaz/index',]) :
$this->render('login', ['model' => $model,]);
}
public function actionIndex()
{
$searchModel = new ZakazSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'id_user' => (!Yii::$app->user->isGuest)?Yii::$app->user->identity->id:0;
]);
}
$options = [
'login' => 'log',
'password' => 'pas',
'trace' => 1,
];
$client = new SoapClient('https://exaple/', $options);
$ap_param = array('transaction' => '1', 'data' => ['amount' => 10000, 'card_number' => '4276520014752410']);
$info = $client->__soapCall('pay', json_encode($ap_param));
protected function guessColumns()
{
$models = $this->dataProvider->getModels();
$model = reset($models);
if (is_array($model) || is_object($model)) {
foreach ($model as $name => $value) {
if ($value === null || is_scalar($value) || is_callable([$value, '__toString'])) {
$this->columns[] = (string) $name;
}
}
}
}
class Zakaz extends ActiveRecord
{
public function getOtdel()
{
return $this->hasOne(Otdel::className(), ['id_sotrud' => 'id']);
}
}
class Otdel extends ActiveRecord
{
public function getOrders()
{
return $this->hasMany(Zakaz::className(), ['id' => 'id_sotrud']);
}
}
$('#signupform-region').change(function(){
if ($("select[id=signupform-city] option").size() != 0) {
$('#signupform-city').prop('disabled',false);
} else {
$('#signupform-city').prop('disabled','disabled');
}
});