yii2

Yii2: Not Found (#404): Unable to find debug data tagged with '5578effb0790c4.13707485'

旧时模样 提交于 2020-07-17 09:28:32
问题 I'm getting this at the bottom of my page, where the debug bar should be. What is the problem? This request: http://localhost:81/xxx/web/debug/default/toolbar?tag=5578f180963e82.28312577 is returning 404. I need to see the error message & stack trace generated when I log to Yii::error() . It's not showing in runtime/log/app.log , so I need the debug bar. 回答1: I removed files from frontend/runtime/debug and frontend/runtime/cache and nothing was changed. But when I removed all folders from

How to pass node id for each node clicked in kartik treeview?

社会主义新天地 提交于 2020-07-03 13:08:54
问题 I have multiple nodes. I want to show different views on each node click. For this, I have to pass the node id. Below is my code in which I have tried to explain the total scenario `<?= TreeView::widget([ 'query' => \common\models\MdcNode::find()->addOrderBy('root, lft'), 'headingOptions' => ['label' => 'Root'], 'rootOptions' => ['label'=>'<span class="text-primary">Root</span>'], 'topRootAsHeading' => true, // this will override the headingOptions //'displayValue' => 1, // initial display

How to pass node id for each node clicked in kartik treeview?

折月煮酒 提交于 2020-07-03 13:05:16
问题 I have multiple nodes. I want to show different views on each node click. For this, I have to pass the node id. Below is my code in which I have tried to explain the total scenario `<?= TreeView::widget([ 'query' => \common\models\MdcNode::find()->addOrderBy('root, lft'), 'headingOptions' => ['label' => 'Root'], 'rootOptions' => ['label'=>'<span class="text-primary">Root</span>'], 'topRootAsHeading' => true, // this will override the headingOptions //'displayValue' => 1, // initial display

Yii2 Allowed memory size exhausted

萝らか妹 提交于 2020-06-23 07:57:28
问题 I'm uploading file to my Yii2 project. The file it self is ~100kB, contains ~45 000 short lines that are processed by controller and added line-by-line to the database. How could I trace exactly when the error occurs or what it is that's eating up the memory? The limit set in php.ini is currently 512MB. And what does LogTarget have to do with it anyway? Afaik i'm not logging anything during this upload and update process. Can this thing happen, when something else is using server's memory? A

How to hide columns based on condition in yii2 gridview?

放肆的年华 提交于 2020-06-17 14:44:21
问题 I have placed a conditional statement in my index page. Controller $type ="402"; // type can me 401 and 403 $searchModel = new MdcmetersdataSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'type' => $type ]); Index.php <?php if($type == '401') { $columns = [ ['class' => 'yii\grid\SerialColumn'], 'device_id', 'cust_id', 'msn', 'current_p1', 'current_p2', 'current_p3',

Trying to get property of non-object in yii2

元气小坏坏 提交于 2020-05-27 06:17:05
问题 I want access to hasMany relation but i get error with this content PHP Notice – yii\base\ErrorException Trying to get property of non-object this is my view : news/index.php <?php foreach($models as $model): ?> <!-- Project One --> <div class="row"> <div class="col-md-2"> <a href="#"> <img class="img-responsive" src="photos/<?=$model->photos->id?>.jpg" alt=""> </a> </div> <div class="col-md-10"> <h4> <div class="row"> <div class="col-sm-8"> دسته بندی:<?= $model->cat->name; ?> </div> <div

Trying to get property of non-object in yii2

六月ゝ 毕业季﹏ 提交于 2020-05-27 06:16:46
问题 I want access to hasMany relation but i get error with this content PHP Notice – yii\base\ErrorException Trying to get property of non-object this is my view : news/index.php <?php foreach($models as $model): ?> <!-- Project One --> <div class="row"> <div class="col-md-2"> <a href="#"> <img class="img-responsive" src="photos/<?=$model->photos->id?>.jpg" alt=""> </a> </div> <div class="col-md-10"> <h4> <div class="row"> <div class="col-sm-8"> دسته بندی:<?= $model->cat->name; ?> </div> <div

Trying to get property of non-object in yii2

試著忘記壹切 提交于 2020-05-27 06:16:09
问题 I want access to hasMany relation but i get error with this content PHP Notice – yii\base\ErrorException Trying to get property of non-object this is my view : news/index.php <?php foreach($models as $model): ?> <!-- Project One --> <div class="row"> <div class="col-md-2"> <a href="#"> <img class="img-responsive" src="photos/<?=$model->photos->id?>.jpg" alt=""> </a> </div> <div class="col-md-10"> <h4> <div class="row"> <div class="col-sm-8"> دسته بندی:<?= $model->cat->name; ?> </div> <div

Yii2 $this->registerJs($js); How to pass php variable inside the $js

末鹿安然 提交于 2020-05-27 03:04:09
问题 Below is my ajax script in my view. $js = <<< JS $('.list-link').click(function(){ $.ajax({ url: '?r=public/getlist&param1=01&param2=02&param3=03', dataType: "json", success: function(data) { $(".well").html(data.id); } }) }); JS; $this->registerJs($js); Now my problem is how am I going to make the values of param1, param2 and param3 dynamic like I am going to pass the params1 to 3 from php variables. 回答1: You could do it this way: $url = \yii\helpers\Url::to([ 'public/getlist', 'param1' =>

Yii2 $this->registerJs($js); How to pass php variable inside the $js

可紊 提交于 2020-05-27 03:03:02
问题 Below is my ajax script in my view. $js = <<< JS $('.list-link').click(function(){ $.ajax({ url: '?r=public/getlist&param1=01&param2=02&param3=03', dataType: "json", success: function(data) { $(".well").html(data.id); } }) }); JS; $this->registerJs($js); Now my problem is how am I going to make the values of param1, param2 and param3 dynamic like I am going to pass the params1 to 3 from php variables. 回答1: You could do it this way: $url = \yii\helpers\Url::to([ 'public/getlist', 'param1' =>