Wiki

Articles in category "tips"X
Displaying 1-10 of 154 result(s).

Yii2 Report Grid

Created 2 months ago by Chris BackhouseTips0 comments – viewed 3,913 times – ( +3 ) – version 2.0
There are some very advanced grids in the Yii2 community, specifically Kartik's amazing gridview extensions but they all designed for interactive screen use.
tags: GridView, report

REST API and null values in XML

Created 10 months ago by marko60Tips0 comments – viewed 7,735 times – ( -1 ) – version 2.0
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 element is taken to represent a null value, but this may create problem with some parsers.
tags: REST, XML, null

A universal model attribute for its synthetic representation

Created about a year ago by Alexandre RodichevskiTips2 comments – viewed 4,242 times – ( -1 ) – version 2.0
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.

Boost composer-asset-plugin update speed

Created about a year ago by schmunkTips5 comments – viewed 10,223 times – ( +5 / -1 ) – version 2.0
If you're using a lot of bower and npm assets with Yii 2.0 you might encounter long running composer update tasks.

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

Created about a year ago by AlaFalakiTips1 comment – viewed 15,263 times – ( +2 / -1 ) – version 2.0
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)

Yii2: Query build for complexity SQL

Created about a year ago by Scott_HuangTips0 comments – viewed 8,358 times – ( -1 ) – version 2.0
As for complexity SQL query we have two solutions as below, I will discuss #2 in this article.

Load & Save With Relation

Created 2 years ago by moo.tensaiTips0 comments – viewed 8,183 times – ( +2 / -1 ) – version 2.0
Use this extension : yii2-relation-trait

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

Created 2 years ago by Louis GacTips0 comments – viewed 8,952 times – ( +1 / -1 ) – version 2.0
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.
tags: search, get, Scenarios

Customize your Growl/Alert msg easy and quickly

Created 2 years ago by Scott_HuangTips0 comments – viewed 6,459 times – ( +3 / -2 ) – version 2.0
I leverage Kartik's notification widgets.

Using PayPal IPN with Yii2

Created 2 years ago by dariooTips0 comments – viewed 6,360 times – ( -1 ) – version 2.0
I'm using PayPal's script from