yii2-advanced-app

Yii2 Exception: ApcCache requires PHP apc extension to be loaded

て烟熏妆下的殇ゞ 提交于 2020-03-03 12:15:53
问题 I receive the exception when configure the cache components in main configuration of advanced-template frontend, on my php.ini the extension rsults enabled, how I can fix this problem? frontend/config/main.php: 'cache' => [ 'class' => 'yii\caching\ApcCache', 'keyPrefix' => 'myapp', // a unique cache key prefix ], The phpinfo() about apcu: 回答1: Solved by updating the configuration as follow: 'cache' => [ 'class' => 'yii\caching\ApcCache', 'keyPrefix' => 'myapp', // a unique cache key prefix

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

Reportico : yii2 How to embed Links?

浪子不回头ぞ 提交于 2020-01-17 07:37:58
问题 I have created a Reportico Project named "atom" and a Report called "Receipts" and then I created action=receipts in ReportController. This is the tutorial I followed: Controller code : public function actionReceipts() { return $this->render('receipts'); } I created receipts.php <?php use yii\helpers\Html; use yii\helpers\Url; $this->title = Yii::t('app', 'Reports'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="report-index"> <div class="container"> <div class="row"> <div

Setting empty text in kartik dynagrid

做~自己de王妃 提交于 2020-01-15 10:54:10
问题 Am using kartik dynagrid and i would like to setup a text that shows when the dataprovider returns empty The grid echo DynaGrid::widget([ 'columns' => $columns, 'showPersonalize' => true, 'emptyText'=>'Sorry all pr have pritems',///-----------------This is what i had set 'options' => ['id' => 'assignsolic-grid'], 'gridOptions' => [ 'options' => ['id' => 'grid'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary'=>false, 'pager' => [ 'firstPageLabel' => 'First',

Setting empty text in kartik dynagrid

那年仲夏 提交于 2020-01-15 10:53:45
问题 Am using kartik dynagrid and i would like to setup a text that shows when the dataprovider returns empty The grid echo DynaGrid::widget([ 'columns' => $columns, 'showPersonalize' => true, 'emptyText'=>'Sorry all pr have pritems',///-----------------This is what i had set 'options' => ['id' => 'assignsolic-grid'], 'gridOptions' => [ 'options' => ['id' => 'grid'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary'=>false, 'pager' => [ 'firstPageLabel' => 'First',

Setting empty text in kartik dynagrid

风格不统一 提交于 2020-01-15 10:53:09
问题 Am using kartik dynagrid and i would like to setup a text that shows when the dataprovider returns empty The grid echo DynaGrid::widget([ 'columns' => $columns, 'showPersonalize' => true, 'emptyText'=>'Sorry all pr have pritems',///-----------------This is what i had set 'options' => ['id' => 'assignsolic-grid'], 'gridOptions' => [ 'options' => ['id' => 'grid'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary'=>false, 'pager' => [ 'firstPageLabel' => 'First',

how to place yii2 form error in title of anchor tag

拥有回忆 提交于 2020-01-15 03:45:06
问题 how to place yii2 form error in title of anchor tag This is my code $form = ActiveForm::begin([ 'id' => 'login-form', 'options' => ['class' => 'form-horizontal'], 'fieldConfig' => [ 'template' => ' {label} <div class="error-block"> <a href="#" title="{error}">error</a> </div> {input} ', 'errorOptions' => ['tag' => null] ], ]); I want to add error in title of anchor tag in YII2 <a href="#" title="{error}">error</a> 回答1: You need to display the error text inside the anchor tags title attribute,

What is best way to redirect on login page in yii2

左心房为你撑大大i 提交于 2020-01-13 03:55:09
问题 If user is not logged in then user should have to be redirect on login page, for that i found function which is working fine for me, i used below function public function beforeAction($action) { if (\Yii::$app->getUser()->isGuest && \Yii::$app->getRequest()->url !== Url::to(\Yii::$app->getUser()->loginUrl) ) { \Yii::$app->getResponse()->redirect(\Yii::$app->getUser()->loginUrl); } return parent::beforeAction($action); } This is working fine for me, but for this i need to add function in every