yii2

Yii2: How can I place something into a Breadcrumbs widget?

ぐ巨炮叔叔 提交于 2019-12-23 22:16:16
问题 I find the Breadcrumbs widget quite useful. However, on the right side within the widget there is enough space for something else. If I'd like to put a link ('a' tag, but could be actually any other small thing) right aligned into the Breadcrumbs, how could I do that? What is a simple and proper solution? Should I extend the class, develop my own, use begin and end of the widget somehow? 回答1: If you look at yii\widgets\Breadcrumbs you see that there is a third parameter in the breadcrumbs

Yii2 Gridview get all selected row for all pagination

天涯浪子 提交于 2019-12-23 21:05:18
问题 I wrapped my gridview with Pjax widget like this \yii\widgets\Pjax::begin(); gridview \yii\widgets\Pjax::end(); in order to make the gridview make ajax request when I click on each pagination. I also use ['class' => 'yii\grid\CheckboxColumn'], in column as well. and I find that when I'm on first pagination I checked some rows and then go to second page and check some rows but when I go back to first page what I've checked is gone. My question is how can I keep all checkedrow for all

Strange error #32 on website's bottom using yii2

≡放荡痞女 提交于 2019-12-23 20:17:14
问题 I am using yii2 , and I have recently uploaded my whole website on the godaddy shared server. I have uploaded on the root folder my all other folders like controller , vendors , config etc Then I have uploaded my "web" folder files like index.php and themes etc to public_html folder. Everything works fine on the server but suddenly sometime it shows at the end of my page. This randomly appear when i refresh my server I am not sure. Error (#32) An internal server error occurred. The above

Error when embed image in mail using Yii2

落花浮王杯 提交于 2019-12-23 20:14:05
问题 I want to embed images in my mail body and I follow the documentation on http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html . My code in the controller looks like this: $messages[] = Yii::$app->mailer->compose('downNotify', [ 'websiteList' => $websiteList, 'logo' => Url::to('@web/mail/images/logo.png') ]) And in the mail view file: <a href="#"><img width="100" src="<?= $message->embed($logo); ?>"></a> However when I run it, it gives me the error: fopen(/WEBSITE_MONITOR/web/mail

Yii2: How to show checked values in CheckboxList

余生长醉 提交于 2019-12-23 20:05:48
问题 I want to show checked values in my checkboxlist in Yii 2.0. Following is my code: Main Array: <?php $featureArr = array( 'Change Requester' => 'Change Requester', 'Clone Request' => 'Clone Request', 'Suspend Request' => 'Suspend Request', 'In-Process Requests Open in Edit Mode' => 'In-Process Requests Open in Edit Mode', 'Allow On-the-Fly Notifications' => 'Allow On-the-Fly Notifications', 'Additional Comments Field' => 'Additional Comments Field', 'Do Not Validate Draft Requests' => 'Do Not

One function is overriding other in javascript - yii2

自闭症网瘾萝莉.ら 提交于 2019-12-23 17:33:11
问题 I'm trying to get productname,productiondate and prodqty from production model in gridview and also the sum(prodqty) in a textbox when a particular product is selected. The gridview is populating fine. I can see the sum(prodqty) javascript alert in a flash. But it's not passing to the textbox. The error message is - uncaught exception: unknown (can't convert to string) Again if I comment out the code for the gridview, the sum(prodqty) is shown in the textbox but I don't get the gridview. My

Convert from query to ModelSearch of Yii2

北战南征 提交于 2019-12-23 17:18:47
问题 I'm new in Yii2, and I have a query with right result: SELECT DISTINCT workloadTeam.project_id, wp.project_name, workloadTeam.user_id, workloadTeam.commit_time, wp.workload_type FROM (SELECT p.id, p.project_name, w.user_id, w.commit_time, w.comment, w.workload_type FROM workload as w, project as p WHERE w.user_id = 23 AND p.id = w.project_id) wp INNER JOIN workload as workloadTeam ON wp.id = workloadTeam.project_id But in my ModelSearch.php, I wrote: $user_id = Yii::$app->user->id; $subquery

yii2 - model load function does not set some model attributes

你离开我真会死。 提交于 2019-12-23 17:04:21
问题 I'm working on a PHP Yii2 application. I have a strange problem with yii2 yii\base\Model.load function. Here is my problem: I have a form model called PaymentIncreaseBalanceForm like below: class PaymentIncreaseBalanceForm extends yii\base\Model { public $amount; public $receiptNumber; public $description; ... } Here is part of my view file: <?= $form->field($model, 'amount')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'receiptNumber')->textInput(['maxlength' => true]) ?> <?

how to get post value from multiple array in yii2

本小妞迷上赌 提交于 2019-12-23 16:33:02
问题 I want to get value of post array in yii2, I have array like this [Brand] => Array ( [name] => Array ( [0] => testing [1] => jkhkjhjkhjk ) [tagline] => Array ( [0] => kjhjkh [1] => ) [meta_keyword] => Array ( [0] => [1] => ) [sort_order] => [image] => brand/1452498338552.jpg [status] => ) ) I tried to get value with below function, but i am unable to get it. $request = Yii::$app->request; $request->post('Brand[name][0]'); How can i get value of name array ? I don't want to use it like $_POST[

No error message when Login fail Yii2

我与影子孤独终老i 提交于 2019-12-23 12:42:42
问题 I'm currently using Yii2 framework. In the Login page,when I have a failed login, it just refreshes the view, but no errors displayed. Here's my current view: <?php use yii\helpers\Html; use yii\bootstrap\ActiveForm; /* @var $this yii\web\View */ /* @var $form yii\bootstrap\ActiveForm */ /* @var $model \common\models\LoginForm */ //$this->title = 'Welcome to my site'; //$this->params['breadcrumbs'][] = $this->title; ?> <div class="site-login"> <h1><?= Html::encode($this->title) ?></h1> <div