yii2

Checked items in Yii2 checkboxList

[亡魂溺海] 提交于 2021-01-08 09:47:07
问题 I've got a dummy problem with checkboxList in ActiveForm. So I've got two models (I cut off irrelevant code): Object model: class Object extends ActiveRecord { public $oFacilities = array(); public static function tableName() { return 'objects'; } public function getObjectFacilities(){ return $this->hasMany(Facility::className(),['id' => 'facilityId'])->viaTable('objectsfacilities', ['objectId' => 'id']); } } Facility model: class Facility extends ActiveRecord { public static function

Checked items in Yii2 checkboxList

瘦欲@ 提交于 2021-01-08 09:42:21
问题 I've got a dummy problem with checkboxList in ActiveForm. So I've got two models (I cut off irrelevant code): Object model: class Object extends ActiveRecord { public $oFacilities = array(); public static function tableName() { return 'objects'; } public function getObjectFacilities(){ return $this->hasMany(Facility::className(),['id' => 'facilityId'])->viaTable('objectsfacilities', ['objectId' => 'id']); } } Facility model: class Facility extends ActiveRecord { public static function

Checked items in Yii2 checkboxList

霸气de小男生 提交于 2021-01-08 09:39:19
问题 I've got a dummy problem with checkboxList in ActiveForm. So I've got two models (I cut off irrelevant code): Object model: class Object extends ActiveRecord { public $oFacilities = array(); public static function tableName() { return 'objects'; } public function getObjectFacilities(){ return $this->hasMany(Facility::className(),['id' => 'facilityId'])->viaTable('objectsfacilities', ['objectId' => 'id']); } } Facility model: class Facility extends ActiveRecord { public static function

YII2 Active Form show custom validation message

蓝咒 提交于 2021-01-07 06:31:30
问题 I have login form which, where I am implementing 2 Factor Authentication integrating twilio API. The API is working fine and I can get the verification response for success or failure. Now I am somehow not able to display the message "OTP verification Failed" on the form. here is my controller code: public function actionLogin() { $this->layout = '@app/themes/backend/login'; $model = new LoginForm(['scenario' => 'login']); if (Yii::$app->request->isAjax && $model->load($_POST)) { $authy_id =

Downgrading from bootstrap 4 to 3 in yii2

China☆狼群 提交于 2021-01-07 01:23:51
问题 I was currently working on a project using the yii2 framework. I wanted to try out using bootstrap 4.0 with my project and added "yiisoft/yii2-bootstrap": "~2.1.0@dev" to my composer.json file and ran composer update . This successfully installed bootstrap 4.0.0 in the project but when I started to browse my project to see what was affected I realized that the yii\bootstrap\Modal component was not working. Because of this, I want to revert my project back to using bootstrap 3 and changed my

Downgrading from bootstrap 4 to 3 in yii2

Deadly 提交于 2021-01-07 01:21:41
问题 I was currently working on a project using the yii2 framework. I wanted to try out using bootstrap 4.0 with my project and added "yiisoft/yii2-bootstrap": "~2.1.0@dev" to my composer.json file and ran composer update . This successfully installed bootstrap 4.0.0 in the project but when I started to browse my project to see what was affected I realized that the yii\bootstrap\Modal component was not working. Because of this, I want to revert my project back to using bootstrap 3 and changed my

$_SERVER['HTTP_AUTHORIZATION'] is missing

安稳与你 提交于 2021-01-03 06:55:39
问题 This is my .htaccess file: RewriteEngine on RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php Even though I have added below line to my .htaccess file I cannot access $_SERVER['HTTP_AUTHORIZATION'] . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] When I'm doing print_r($_SERVER) I can't find HTTP_AUTHORIZATION . I have googled for an answer but none of them worked. 回答1:

$_SERVER['HTTP_AUTHORIZATION'] is missing

試著忘記壹切 提交于 2021-01-03 06:55:13
问题 This is my .htaccess file: RewriteEngine on RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php Even though I have added below line to my .htaccess file I cannot access $_SERVER['HTTP_AUTHORIZATION'] . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] When I'm doing print_r($_SERVER) I can't find HTTP_AUTHORIZATION . I have googled for an answer but none of them worked. 回答1:

$_SERVER['HTTP_AUTHORIZATION'] is missing

落花浮王杯 提交于 2021-01-03 06:53:06
问题 This is my .htaccess file: RewriteEngine on RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php Even though I have added below line to my .htaccess file I cannot access $_SERVER['HTTP_AUTHORIZATION'] . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] When I'm doing print_r($_SERVER) I can't find HTTP_AUTHORIZATION . I have googled for an answer but none of them worked. 回答1:

yii2 - yii2 queue - save to db and log not working within curl job

半城伤御伤魂 提交于 2020-12-15 05:47:22
问题 I am using https://github.com/yiisoft/yii2-queue I have function in execute method in queue class like: $this->RegisterDomains($available,$registrar->end_point, $this->request_id,$model->user_id,$registrar->api_key); and the registerDomains function looks like this: public function RegisterDomains($available,$end_point,$request_id,$user_id,$api_key) { $model = CatchDomains::find()->where(['request_id'=>$request_id])->one(); $PathToLog = 'runtime/domaincatch'; if(!(is_array($available['domain'