yii2

yii2 mogodb RBAC configuration

自闭症网瘾萝莉.ら 提交于 2020-01-30 10:59:25
问题 I have installed yii2 mongodb extension, I am able to create mongodb collection, model etc. I have also installed https://github.com/imanilchaudhari/yii2-mongodb-admin, but there are no docs, how to configure the same. but it contains some hints, which I am not able to make out like GUI manager for RBAC. Use [[\yii\base\Module::$controllerMap]] to change property of controller. To change listed menu, use property [[$menus]]. 'layout' => 'left-menu', // default to null mean use application

yii2 mogodb RBAC configuration

自作多情 提交于 2020-01-30 10:59:25
问题 I have installed yii2 mongodb extension, I am able to create mongodb collection, model etc. I have also installed https://github.com/imanilchaudhari/yii2-mongodb-admin, but there are no docs, how to configure the same. but it contains some hints, which I am not able to make out like GUI manager for RBAC. Use [[\yii\base\Module::$controllerMap]] to change property of controller. To change listed menu, use property [[$menus]]. 'layout' => 'left-menu', // default to null mean use application

Yii2 - subdomain routing

不打扰是莪最后的温柔 提交于 2020-01-30 05:17:06
问题 I want to use subdomain as id, and I need dynamic router to do this. In urlManager , I added this line: "http://<user:\w+>.local.dev/<controller:\w+>/<action>" => '<controller>/<action>', When I try any action, for example: function actionMyAccount($user){ echo $user;... } I am not getting anything - the var isn't printed, and script stops working (screen is white). When I remove $user, the page is loading without any problems How can I achieve subdomain router? 回答1: I think your router

Adding new row in dynamic form yii2, in new row, js is not work

十年热恋 提交于 2020-01-25 21:43:45
问题 I have a case to manage a dynamic input in yii2. So I choose this extension : wbraganca This is my code : <?php $form = ActiveForm::begin(['id' => 'dynamic-form']); ?> <div class="row"> <div class="col-md-8"> <div class="padding-v-md"> <div class="line line-dashed"></div> </div> <?php DynamicFormWidget::begin([ 'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_] 'widgetBody' => '.container-items', // required: css class selector

select2 widget selected will updated other select2

一笑奈何 提交于 2020-01-25 12:05:32
问题 Hi all i am newbie in yii2 need your advise i use select2 widget, when i selected value it will throw another value that i had set in array before. so how can i do this in yii2. so far i doing this.i have try using jquery function using pluginevents in select2 but still stuck..here is my code <?= $idnpwp = ArrayHelper::map(Mfwp::find()->all(),"id", "npwp", "nama_wp");?> <?= $form->field($model, 'npwp')->widget(Select2::classname(), [ 'language' => 'id', 'data' => $idnpwp, 'options' => [

select2 widget selected will updated other select2

喜欢而已 提交于 2020-01-25 12:03:46
问题 Hi all i am newbie in yii2 need your advise i use select2 widget, when i selected value it will throw another value that i had set in array before. so how can i do this in yii2. so far i doing this.i have try using jquery function using pluginevents in select2 but still stuck..here is my code <?= $idnpwp = ArrayHelper::map(Mfwp::find()->all(),"id", "npwp", "nama_wp");?> <?= $form->field($model, 'npwp')->widget(Select2::classname(), [ 'language' => 'id', 'data' => $idnpwp, 'options' => [

Yii2 - RBAC rule to allow/view own data

旧时模样 提交于 2020-01-25 09:43:09
问题 I have installed yii2mod/yii2-rbac from this url - https://github.com/yii2mod/yii2-rbac in yii2-basic. everything is working fine except using/allowing owner data. from this link:https://www.yiiframework.com/doc/guide/2.0/en/security-authorization I have created a folder in root rbac and file AuthorRule.php and code: namespace app\rbac; use yii\rbac\Rule; //use app\models\Post; /** * Checks if authorID matches user passed via params */ class AuthorRule extends Rule { /** * @var string */

Showing kartik growl via ajax in yii2

时间秒杀一切 提交于 2020-01-24 09:05:28
问题 Am using kartik growl and i would like to show the growl via ajax success I have tried This is the javascript code: $.post({ url: "forwardpr", // your controller action dataType: 'json', data: {keylist: keys,user:userdata}, success: function(data) { console.log(data); //$.pjax.reload({container:'#forward-grid'}); $.growl( data.growl ); }, error: function(err){ alert(err); console.log("server error"); } }); This is the controller code: $growl = [ 'title' => "Group members updated.<hr>", 'icon'

Class 'Imagine\Gd\Imagine' not found in yii2

元气小坏坏 提交于 2020-01-24 04:03:07
问题 I am working on crop image module, I need detail of uploaded image so i am using this function $image = Image::getImagine()->open($path); $size = $image->getSize(); While using this function it is giving me error Class 'Imagine\Gd\Imagine' not found case self::DRIVER_IMAGICK: if (class_exists('Imagick', false)) { return new \Imagine\Imagick\Imagine(); } break; case self::DRIVER_GD2: if (function_exists('gd_info')) { return new \Imagine\Gd\Imagine(); } break; default: throw new

Class 'Imagine\Gd\Imagine' not found in yii2

半世苍凉 提交于 2020-01-24 04:03:01
问题 I am working on crop image module, I need detail of uploaded image so i am using this function $image = Image::getImagine()->open($path); $size = $image->getSize(); While using this function it is giving me error Class 'Imagine\Gd\Imagine' not found case self::DRIVER_IMAGICK: if (class_exists('Imagick', false)) { return new \Imagine\Imagick\Imagine(); } break; case self::DRIVER_GD2: if (function_exists('gd_info')) { return new \Imagine\Gd\Imagine(); } break; default: throw new