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
8
votes
3 answers

Yii2 - Getting unknown property: yii\console\Application::user

I am trying to run a console controller from the terminal, but i am getting this errors every time Error: Getting unknown property: yii\console\Application::user here is the controller class TestController extends \yii\console\Controller { public…
Tariq Albajjali
  • 327
  • 1
  • 6
  • 16
8
votes
1 answer

Setting a dynamic timezone in yii2

Does anyone know how to set a dynamic timezone for each user? If the timezone is stored in database, how do i get it from db and set it at runtime so that i dont need to set it everytime in my codes?
user2707590
  • 1,066
  • 1
  • 14
  • 28
8
votes
1 answer

Using Yii1 and Yii2 in the same project

I had a project in Yii1.x and now I am using Yii2 for the same projects Project hierarchy is something like this Project1(yii1)/all yii files + project2(yii2) project2(yii2)/frontend + /common + /backend Now I want to know if is it possible to…
Mike Ross
  • 2,942
  • 5
  • 49
  • 101
8
votes
5 answers

Yii2 View DateTime Format (d-m-Y H:i:s) But When Save/update in DB Change format to Y-m-d H:i:s

I'm Using Kartik DateTimePicker Extension field($model, 'Created')->widget(DateTimePicker::classname(),[ 'model' => $model, 'attribute' => 'Created', 'name' => 'Created', 'options' => ['placeholder' =>…
Kailas
  • 3,173
  • 5
  • 42
  • 52
8
votes
3 answers

Yii2 params access within local config file in common directory

I'm using Yii2 advanced template, I want to access params.php in main-local.php file, I called this ways: main-local.php: 'mailer' => [ 'class' => 'myClass', 'apikey' => \Yii::$app->params['mandrill_api_key'], …
Muhammad Shahzad
  • 9,340
  • 21
  • 86
  • 130
8
votes
3 answers

Yii2 dropdownList select default option

I am returning cat_id value by GET in url to say that my dropdown list, which Item must be select. But it's not working. field($model, 'cat_id')->dropDownList( ArrayHelper::map(DeviceCats::find() ->where(['is_deleted' =>…
Mojtaba
  • 4,852
  • 5
  • 21
  • 38
8
votes
1 answer

Yii2 Invalid CAPTCHA action ID in module

I am getting the Invalid CAPTCHA action ID Exception in my custom contactus module. I managed to display the captcha but models validation rule throws the invalid action ID exception. Below is my…
Chinmay Waghmare
  • 5,368
  • 2
  • 43
  • 68
8
votes
9 answers

Yii 2 gii is generating view files on different directory

I am new to yii framework. On yii version:2.0.1 I have created a module in which I tried to generate a CRUD model using the gii functionality. After putting the model class, controller class and view path when I clicked on generate gii showed all…
Sid
  • 170
  • 1
  • 1
  • 10
7
votes
2 answers

Yii2-curl oAuth2 with zoho

I am working on Yii2. I have a URL which on hitting a browser is redirected to my redirect URI.…
Moeez
  • 494
  • 9
  • 55
  • 147
7
votes
1 answer

Count all record in table in yii2 without where clause

I want to count all record from table without specify any condition : now, i am doing by this way $result['cms'] = Cms::find()->where([])->count(); and it will give me result,but i don't want to use where clause. So how to count all records…
Yasin Patel
  • 5,624
  • 8
  • 31
  • 53
7
votes
4 answers

How to resize image by imagine extension in yii2

I use the bellow function to resize images after upload to show on my post. but it works just for images larger than 500px 300px. when I upload image smaller than this size, my website images row breaks down. use yii\imagine\Image; public…
Mohammad Aghayari
  • 1,010
  • 3
  • 15
  • 38
7
votes
3 answers

Yii2 REST+ Angular Cross Domain CORS

I have developed Angular & Yii2 REST service. Have problem in cross domain. Here below add my angular & Yii2 REST Code. AngularJs : (like 'http://organization1.example.com','http://organization2.example.com',....) $http.defaults.useXDomain =…
ArivuAjay
  • 135
  • 3
  • 11
7
votes
3 answers

Select all record of all page in checkbox column of gridview yii2

I wants to know if there is any inbuilt option in yii2 gridview checkbox column to select/deselect all rows at once.. For example if i have 500 records in a gridview and i am displaying 100 records at once than i can only select 100 records at once…
Mike Ross
  • 2,942
  • 5
  • 49
  • 101
7
votes
3 answers

Render view Yii2

How do you render a view file in the profile module's index view file. I tried this: render('/product/product/_search')?> This is the error I get: The view file does not exist:…
Fuad Ibrahimov
  • 492
  • 2
  • 10
  • 21
7
votes
1 answer

Yii2 How to pass the model instance to the main layout?

I have a change password bootstrap modal which will get triggered when the user clicks on the Change password navBar menu. I have included the modal in the footer. But how can I pass the ChangePassword model instance to the footer layout file? Can…
Chinmay Waghmare
  • 5,368
  • 2
  • 43
  • 68