You could add a getStatus() method (or something like that) in your model class
:
public function getStatus()
{
return $this->isActive() ? 'Active' : 'Inactive';
}
Le 19 févr. 2010 à 18:27, Samuel Morhaim a écrit :
> If I have a field isActive and of course it returns 1 or 0 .. how can
> I change the class to return Active / Inacrive as a string, and not
> doing it on the view for each time i use it?
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.