How to change specific symbol of YII cactiverecord model's attribute ? Dont understand why it doesnt work:
echo $model->attr; // aaa
$model->attr[1] = 'b';
echo $model->attr; // aaa
How to change specific symbol of YII cactiverecord model's attribute ? Dont understand why it doesnt work:
echo $model->attr; // aaa
$model->attr[1] = 'b';
echo $model->attr; // aaa
Use
substr_replacefunction:http://www.php.net/manual/en/function.substr-replace.php
Also you can use this approach:
Your example does not work because actually
$this->AttributeNameexecuteCActiveRecord::getAttribute('AttributeName')method and not affect original value.