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
10
votes
2 answers

ActiveForm without model yii2

I want to create ActiveForm without model for just in case something. I did try with dynamicModel but i got some error : use yii\base\DynamicModel; $model = DynamicModel::validateData(compact('KOMENTAR'), [ [['KOMENTAR'], 'string', 'max' =>…
10
votes
4 answers

Yii2 REST giving a 405 on POST, PUT, etc

I'm trying to build a REST API in a Yii2 advanced application for managing simple queries to my database. Following some tutorials, finally build step by step the example in the Guide, in Quick Start, and get my model working for GET and HEAD…
user3627496
  • 103
  • 1
  • 1
  • 5
10
votes
1 answer

Yii 2 RESTful API authenticate with HTTP Basic (Yii 2 advanced template)

REST API is working without authentication methods. Now i wanted to authenticate REST API with HTTP Basic authentication for API requests via mobile application. I tried with yii2 guide, but it didn't work for me. basically mobile user need to be…
Chanuka Asanka
  • 2,798
  • 3
  • 24
  • 36
9
votes
2 answers

Composer Yii2 Bower: The file or directory to be published does not exist: C:\myProject\vendor\bower/jquery/dist

Error message: PHP User Error – yii\base\ErrorException Exception 'yii\base\InvalidArgumentException' with message 'The file or directory to be published does not exist: C:\myProject\vendor\bower/jquery/dist' in…
aalesund
  • 313
  • 1
  • 4
  • 13
9
votes
5 answers

Yii2 Advanced installation throws error 'Document root "/var/www/html/project/console/web" does not exist.' while running php Yii serve

I have tried yii2 advanced installation, it works and the pages have been created. But to verify installation I used the command PHP YII serve. it throws the error Document root "/var/www/html/highwaymotels/console/web" does not exist. But when I…
Abel
  • 2,371
  • 3
  • 15
  • 29
9
votes
3 answers

Yii 2 canonical URL in urlManager configuration

I've got urlManager section in app configuration with several URLs per route: 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => true, 'rules' => [ …
Estus Flask
  • 206,104
  • 70
  • 425
  • 565
9
votes
2 answers

Yii2 How to add parameters to script tag

The JS assests that gets renders looks like this: I need to add the async="async" tag to it. so it should look like How…
Chinmay Waghmare
  • 5,368
  • 2
  • 43
  • 68
9
votes
1 answer

Yii2 - Multi language

I'm trying to set up the website's frontend translation using the i18l thing. Here is my i18l.php file placed on frontend/config 'frontend', 'languages' => ['en-US', 'pt-BR'] , //Add languages to the array…
Alessandro Resta
  • 1,102
  • 1
  • 19
  • 26
9
votes
3 answers

Yii 2 RESTful API authenticate with OAuth2 (Yii 2 advanced template)

REST API is working without authentication methods. Now i wanted to authenticate REST API with OAuth2 authentication for API requests via mobile application. I tried with yii2 guide, but it didn't work for me. basically mobile user need to be…
Chanuka Asanka
  • 2,798
  • 3
  • 24
  • 36
9
votes
3 answers

yii2: How to work with font awesome icons?

I have this HTML link tag that I need to generate using yii\helpers\Html Sign Up I am able to do it using method a() but I do not know how to include the…
Zack
  • 1,527
  • 2
  • 20
  • 32
9
votes
2 answers

Yii2 Pjax not working

I want to refresh the gridview using Pjax but somehow it is not working. Here is the code: _search.php registerJs(" …
Chinmay Waghmare
  • 5,368
  • 2
  • 43
  • 68
9
votes
1 answer

Equivalent of "Yii::app()->runController('controller/action')" in Yii2?

What is the equivalent function of: Yii::app()->runController('controller/action') in Yii2? I would like to call a action from another controller in current controller. Thanks.
Maulana Yusuf
  • 337
  • 2
  • 4
  • 16
9
votes
2 answers

How to create a reusable widget in Yii2

I have made a simple widget in my current project of yii2. Simply, it creates a select options list for all jui themes and allow the user to change the theme and save it by the mean of cookies. This widget need two javascript files, -they are…
SaidbakR
  • 13,303
  • 20
  • 101
  • 195
9
votes
1 answer

How can I upgrade Yii 1.x to Yii 2.0?

How can I upgrade the Yii 1.x version to the Yii 2.0 latest release version? I am using an Ubuntu OS. What is the process to updating my old Yii to the new Yii release version 2.0?
8
votes
1 answer

How to display a HTML tag in Yii2 form error summary

I am trying to display a link in error message in login for, but it is not working. The error message in LoginForm valdiation: $this->addError($attribute, 'Your account has been disabled. Enable It'); In login.php (view):