(put code in your model)

2010/8/23 Alexandre Salomé <[email protected]>

> Hello,
>
> You should put labels in class code :
>
> class MyClass
> {
>   const STATUS_OPENED = 0;
>   const STATUS_CLOSED = 1;
>
>   protected $labels = array(
>     self::STATUS_OPENED => "Opened",
>     self::STATUS_CLOSED => "Closed"
>   );
>
>   public function getLabel()
>   {
>     // ...
>   }
> }
>
> 2010/8/23 torok84 <[email protected]>
>
> Hi,
>>
>> I have a model that has a numeric field that indicates a status it can
>> be 1 Opened 2 Closed (It might change in the future). I want to output
>> the status on the view, transalting numbers to strings. I will create
>> an array
>> a[1] = "Open";
>> a[2] = "Closed";
>> I will access the array a in the view to translate the number from the
>> model to nice user friendly string.
>>
>> I looked around and it seems I can put this stuff in config/
>> ProjectConfiguration.class.php. Is it corect?
>>
>> Thanx
>> Paolo
>>
>> --
>> If you want to report a vulnerability issue on symfony, please send it to
>> security at symfony-project.com
>>
>> 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]<symfony-users%[email protected]>
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en
>>
>
>
>
> --
> Alexandre Salomé
> http://alexandre-salome.fr
>



-- 
Alexandre Salomé
http://alexandre-salome.fr

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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

Reply via email to