Wiki articles in category Tips

Showing 1-20 of 155 items.
Created 2 months ago by CeBe, updated a month ago by CeBe.

Configuring PhpStorm IDE for Yii 2

There are a few settings and plugins that can enhance the development experience with Yii in PHPStorm or IntelliJ IDEA. This article explains how to get the most out of your IDE.

7 0
5 followers
Viewed: 5 507 times
Version: 2.0
Category: Tips
Created 11 months ago by Chris Backhouse, updated 2 months ago by Chris Backhouse.

Yii2 Report Grid

There are some very advanced grids in the Yii2 community, specifically Kartik's amazing gridview extensions but they all designed for interactive screen use.

4 0
6 followers
Viewed: 15 100 times
Version: 2.0
Category: Tips
Created a year ago by marko60, updated a year ago by marko60.

REST API and null values in XML

I have been working on a REST API using the excellent tools provided by Yii2. My problem was that I have to differentiate between empty values and null values. In other words, <elem></elem> is different from null as it represents an empty string. Also, although some use <elem/> to represent a null value it should still be interpreted as an empty string. In other cases, the absence of the eleme...

0 0
0 follower
Viewed: 10 154 times
Version: 2.0
Category: Tips
Tags: null, REST, XML
Created a year ago by Alexandre Rodichevski, updated a year ago by Alexandre Rodichevski.

A universal model attribute for its synthetic representation

It is convenient to use the same identification attribute, say info, in all of the active records of your application. It should be a virtual read-only attribute defined by a getter method, its label being the model name.

0 0
3 followers
Viewed: 5 698 times
Version: 2.0
Category: Tips
Created a year ago by schmunk, updated a year ago by samdark.

Boost composer-asset-plugin update speed

If you're using a lot of bower and npm assets with Yii 2.0 you might encounter long running composer update tasks.

5 0
6 followers
Viewed: 14 724 times
Version: 2.0
Category: Tips
Created 2 years ago by AlaFalaki, updated 2 years ago by AlaFalaki.

How to change GridView delete confirmation message for specific controllers only?

Hello,
If you want to give extra attention for some specific delete actions and you don't want to override whole yii.confirm JS method here is what you can do:
(I've only put the ActionColumn part of the GridView here to just give you the idea)

1 0
3 followers
Viewed: 23 126 times
Version: 2.0
Category: Tips
Created 2 years ago by Scott_Huang, updated 2 years ago by Scott_Huang.

Yii2: Query build for complexity SQL

As for complexity SQL query we have two solutions as below, I will discuss #2 in this article.

0 0
3 followers
Viewed: 10 111 times
Version: 2.0
Category: Tips
Created 3 years ago by moo.tensai, updated 2 years ago by moo.tensai.

Load & Save With Relation

Use this extension : yii2-relation-trait

1 0
2 followers
Viewed: 9 795 times
Version: 2.0
Category: Tips
Created 3 years ago by Louis Gac, updated 3 years ago by Louis Gac.

Building a search GET request with scenarios ; calling a SearchModel from URLs...

Search Models are a very elegant and powerful way to build an Active Data Provider. If you use them a lot, you'll quickly need to use scenarios, which will lead you to a very DRY Controller code.

0 0
2 followers
Viewed: 10 888 times
Version: 2.0
Category: Tips
Created 3 years ago by Scott_Huang, updated 3 years ago by Scott_Huang.

Customize your Growl/Alert msg easy and quickly

I leverage Kartik's notification widgets.

0 1
2 followers
Viewed: 8 136 times
Version: 2.0
Category: Tips
Created 3 years ago by darioo, updated 3 years ago by darioo.

Using PayPal IPN with Yii2

I'm using PayPal's script from

0 0
1 follower
Viewed: 7 357 times
Version: 2.0
Category: Tips
Created 3 years ago by VINAY Kr. SHARMA, updated 3 years ago by VINAY Kr. SHARMA.

Things to Consider when application hosting on AppFog

I faced many issues when hosted our company website on AppFog.

1 0
2 followers
Viewed: 4 311 times
Version: 1.1
Category: Tips
Created 3 years ago by johonunu, updated 3 years ago by johonunu.

Debuging variables in Yii2

This tutorial is explained following "basic" application structure.

1 1
6 followers
Viewed: 18 743 times
Version: 2.0
Category: Tips
Created 3 years ago by le_top, updated 3 years ago by le_top.

Selecting best language based on Browser language and available languages.

Your application is international and you have to select the best language for the user. Your user may have selected 'fr_CA' and you have 'fr_FR' or 'fr' available. What do you do? Here is a tip.

2 0
2 followers
Viewed: 7 227 times
Version: 1.1
Category: Tips
Created 3 years ago by VivekYii, updated 3 years ago by VivekYii.

YII2 Pagination Options

solution here If we are using default pagination option like

1 0
1 follower
Viewed: 10 154 times
Version: 2.0
Category: Tips
Created 3 years ago by Rajith R, updated 3 years ago by Rajith R.

Yii Rights Management Tips

yii rights some tips..

2 0
4 followers
Viewed: 7 853 times
Version: 1.1
Category: Tips
Created 3 years ago by Deepak Pradhan, updated 3 years ago by Deepak Pradhan.

Analyse the server's USER-AGENT against browsecap file to determine it's capability.

Does your application need to know user's details on browser details, os and device type? We can use PHP's misc. function to achieve that provided you have an update copy of browsercap.ini

0 0
0 follower
Viewed: 4 232 times
Version: 2.0
Category: Tips
Created 3 years ago by le_top, updated 3 years ago by le_top.

Provide SVG when the browser supports it, else PNG (using CHtml::image overload)

Modern browsers support SVG, older browsers do not. This replacement for CHtml::image() allows you to handle to propose SVG in an efficient way with PNG as a fallback.

1 0
2 followers
Viewed: 5 151 times
Version: 1.1
Category: Tips
Created 3 years ago by Scott_Huang, updated 3 years ago by Scott_Huang.

Easy way to redirect http:\\localhost\yii2-basic to http:\\localhost\yii2-basic\web\index.php

First of all, install yii2 basic template according below link:

1 0
5 followers
Viewed: 21 557 times
Version: 2.0
Category: Tips
Created 3 years ago by Kostas Apazidis (KonApaz), updated 3 years ago by Kostas Apazidis (KonApaz).

Add model validator in Controller

There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way

1 1
3 followers
Viewed: 19 511 times
Version: 1.1
Category: Tips