Wednesday, August 26, 2009

Re: MVC-way to obtain common data formatting

That's a good starting point but there's need to change every
interested line in the views, while I'd like to obtain an automatic
and centralized solution i.e. if I write a new page there should be no
need to remember that "work-around"

On 26 Ago, 15:42, Jon Bennett <jmbenn...@gmail.com> wrote:
> Hi Nicola,
>
> > thanks for your kind reply but that's just what I'd avoid: I'm trying
> > to accomplish an automatic way to achieve that result, I know it's not
> > right to use a model function and I asked for an MVC and non-
> > validation-breaking way..
>
> Another way would be to create a helper.
>
> How about this helper:http://pastie.org/595351
>
> // use it like so
> $data = array('Model'=>array('status'=>1));
> echo $dataConverter->nice('Model.status', 'onoff', $data);
>
> IMHO the thing to remember is that you only adjust the data for
> presentation only, hence it's done in either the view or the
> controller.
>
> hth
>
> jon
>
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: