I am trying to add leading zeros to a number to be shown in Gridview. I am trying this code, but it is throwing error like:
Getting unknown property: app\models\OpdTestBill::0000
The code I am using is like this:
[
'attribute'=>'dhanwantri_bill_number',
'format'=>'raw',
'value'=>sprintf('%04d','dhanwantri_bill_number')
],
What is the proper syntax to achieve this?
Thanks.
Variation
[ 'attribute'=>'dhanwantri_bill_number',
'format'=>sprintf('%04d','dhanwantri_bill_number')
],
Here too I am getting the error:
Unknown format type: 0000
throw new InvalidParamException("Unknown format type: $format")