Category "yii2"

Yii2: how to remove required attribute in a view?

I have a text field that was defined as required in its model. But a view needs not be required. I try this way to remove the required attribute but it doesn't

Yii2: How to download backup files using spanjeta/yii2-backup?

In a Yii2 project I want to download file backup. I have setup the download button in my action column. My code doesn't work, when I click the download button,

Get model by table name in yii2

I have one method in several models, implemented in different ways. I only know the name of table in database. I must find model of this table. How to do? int

Apache Alias - Yii2

I'm using Yii2 advanced template and I wonder if someone has a solution for the following scenario. The web application has both frontend and backend interfaces

Yii2 add LIKE condition with "%" wildcard on the one side

I want to add like condition with % wildcard on the one side, like: where name like 'value%' My code: Table::find()->filterWhere(['like', 'name' , $_GET[

Yii2 ListView summary unknown property

When I try to run the following code <?= ListView::widget([ 'dataProvider' => $dataProvider, 'itemView' => '_fichaRevista', 'summary ' =&

Yii2 ListView summary unknown property

When I try to run the following code <?= ListView::widget([ 'dataProvider' => $dataProvider, 'itemView' => '_fichaRevista', 'summary ' =&

How to hide Yii Web Framework name from Wappalyzer?

I'm trying to hide the framework name Yii from Wappalyzer plugin in Chrome/Firefox. I need to hide the framework name as a part of security audit. I've turned

Problems getting instance of UploadedFile in Yii2

I tried to upload a file to a server using UploadedFile class, but I can't get an Instance. In my Model: public $arch; public function rules() { return [[[

yii2 hidden input value

In Yii2 I'm trying to construct hidden input echo $form->field($model, 'hidden1')->hiddenInput()->label(false); But I also need it to have some va

Yii2 theme integration

I have installed Yii2 advanced application, and now I want to change backend theme. How can I do this? Is there any file where I need to tell Yii2 that use my

Yii2 ArrayDataProvider does not show already paginated data

I have an issue with ArrayDataProvider object that Yii2 provides. I have a huge API call that returns more than 7k items (this is a problem because obtaining al

Subquery in yii2

I have 2 tables projects (id,name) accounts (id,project_id,account_name) I want to find all projects with their account_name like this SELECT Project.*,(S

Subquery in yii2

I have 2 tables projects (id,name) accounts (id,project_id,account_name) I want to find all projects with their account_name like this SELECT Project.*,(S

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

In this section of the yii2 installation guide there's the following instructions: With Composer installed, you can install Yii by running the following c

Session timeout in Yii2

I have used built in yii2 function to set session. I am not able to use built in yii2 login because of some requirement. So I have set session using below:

Yii2: How do I debug console commands?

The Yii2 debugger seems to only work for web requests. How can I debug console commands (CLI)? Eg. I need to see the SQL statements that were executed during a

yii2 register js code in a view

What is the best way to register js code in yii2 view? 1 <?php $this->registerJs( '$("document").ready(function(){ alert("hi"); });' ); ?&