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.
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.
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)
Generally we need to show one or more fields from a model that is related to another model used in CGridView.
For our case we will use two related models, which explain how to use model "A" fields in a CGridView that used model "B".