Questions tagged [yii2-advanced-app]

Yii 2 Advanced Application Template is a skeleton Yii 2 application best for developing complex Web applications with multiple tiers. The template includes three tiers: front end, back end, and console, each of which is a separate Yii application. The template is designed to work in a team development environment. It supports deploying the application in different environments.

##Resources

2222 questions
5
votes
2 answers

composer command does nothing

I work with yii2 in windows 10 by using xampp in my project, But composer command does nothing at all. To understand more, I have to add this, that composer command works in every path exept one project. my composer.json: { "name":…
Mohammad Aghayari
  • 1,010
  • 3
  • 15
  • 38
5
votes
2 answers

How to make row in gridview clickable?

I am very new to yii2. I have created a gridview using CRUD Generator. I want to make the gridview's rows to be clickable like when we click on view. It should navigate to the view page for that row. My gridview code is as follows:
user2211486
  • 237
  • 1
  • 6
  • 18
5
votes
2 answers

How can I get the selected data/item rows in CheckboxColumn Gridview - Yii2

I have a problem on getting all the selected values/data Yii2 Gridview using checkboxColumn. I can only get one of the value in the grid using this code: 'class' => 'yii\grid\CheckboxColumn', 'checkboxOptions' => function($model,…
Gemark Almacen
  • 340
  • 5
  • 14
5
votes
3 answers

Yii2 Nav Bar add images in menu items

Is it possible to add images in Yii2 Bootstrap Nav Bar menu items? In official doc I haven't found any option. I want to show images instead of Label text! Nav Bar code is. 'My Company', …
Muhammad Shahzad
  • 9,340
  • 21
  • 86
  • 130
5
votes
1 answer

How to override or edit code of vendor directory in yii2?

I need to do some changes in vendor/yiisoft/yii2/web/urlmanager.php for my url_alias to work! I need to know if I can change this file directly or is there any method to override this file?
sphinx
  • 717
  • 1
  • 7
  • 19
5
votes
1 answer

Yii2 Listview pagination with ajax

I'm studying yii2 framework. I have a trouble when use listview wiget. When I click next page I want to update page but not reload. but I don't know how do it? this is url when click next page: http://......&page=1&per-page=5 Please help me? Thank…
Tam Vo
  • 175
  • 2
  • 3
  • 10
5
votes
2 answers

Setting attribute to NULL in Yii2 and save to database

In Yii we had CDbExpression('NULL') what is the equivalent in Yii2? Need to set a database column back to null via a model in Yii2
keeg
  • 3,990
  • 8
  • 49
  • 97
5
votes
4 answers

Access variable in Gridview function yii2

I am trying to access a variable on view file into Gridview but it is throwing error that it should be array but null given i am declaring $totalDays on top of my view file and i am using it in Gridview like below [ 'attribute' => …
Mike Ross
  • 2,942
  • 5
  • 49
  • 101
5
votes
2 answers

delete file after sending to user

I try to send a file to the user with this function Yii::$app->response->sendFile($tmp_filename, 'test.RData'); Now I want the file to be deleted after sending. I know that there's an event handler for send method in yii/web/Response called…
Sarah West
  • 2,047
  • 2
  • 20
  • 37
5
votes
2 answers

How to Customize Yii2 english validations messages translations?

I want to change english validation messages in overall app. so for example: showing "field required" rather than "date of birth is required". I tried to configure the I18N component as following: 'i18n' => [ 'translations' => [ …
Downy
  • 91
  • 2
  • 6
5
votes
2 answers

Advanced Template installation issue [ErrorException] touch(): Utime failed: Permission denied

I am using YII2 for my project,I have created a project(advanced template) using composer, now I need to start another project, firstly I have update composer(composer self-update), it is fine. now I am trying to complete installation process of…
ksn
  • 51
  • 1
5
votes
1 answer

Yii2 Logout link issue

I used this function for logout link instead of using it on menu. this code I used: 'post']) ?> Showing- Method Not Allowed. This url can only handle the following request methods: POST.…
fool-dev
  • 7,671
  • 9
  • 40
  • 54
5
votes
2 answers

Yii2: Is it possible to open a frontend session from backend?

I struggle with yii2 at the moment. Following scenario: I use yii2 advanced template and have a frontend and a backend with separate user tables and logins. Now I'm looking for a way that a backend user can log in as a frontend user from backend.…
Sarah West
  • 2,047
  • 2
  • 20
  • 37
5
votes
3 answers

Yii2: Can I use scenarios to specify different set of model fields for different actions?

I can see in the Yii2 model page (http://www.yiiframework.com/doc-2.0/yii-base-model.html), in the "fields" section that you can set "different lists of fields based on some context information. For example, depending on $scenario or the privilege…
FlamingMoe
  • 2,709
  • 5
  • 39
  • 64
5
votes
2 answers

Delete is not working Method Not Allowed (#405) gridview yii2

This is my gridview, I changed from class actionColumn to this: [ 'format' => 'html', 'contentOptions'=>['style'=>'width: 5px;'], 'value' => function($model) { if($model->id == Yii::$app->user->identity->id)…