Using Yii framework, what would be a right way to process an attribute before displaying it using CH

Posted by Karolis on Stack Overflow See other posts from Stack Overflow or by Karolis
Published on 2010-03-13T02:32:04Z Indexed on 2010/03/13 2:37 UTC
Read the original article Hit count: 371

Filed under:
|
|

Say I have this line of code in the view.

<?php echo CHtml::activeTextField($model,'start_time'); ?>

start_time is a UNIX timestamp. When just displaying it in a view I can apply functions like date() on it. Where should I apply the formatting when I'm displaying it in a form, by using the above line of code? (This case of timestamps/dates might be special, but I'm also interested in how would one go about if it wasn't a date and I just want to work with

"value in database" <> "different representations of the value in different views.

Thanks =)

© Stack Overflow or respective owner

Related posts about yii-framework

Related posts about yii