it is not a good idea to do those things in the model/controller
a) what if you don't need most of the modified fields in the end?
b) what if you somehow need to know in the view which field was empty
in the first place

simply do that in the view templates with if (!empty) etc on "demand"
that is faster and cleaner

but if you really need to be going down that road (i wouldnt) you can
write a behavior which
populates the data and adds fields:
field1
field2
# now additionally:
field1_view
field2_view

this way you keep the original field value if needed


On 8 Aug., 21:12, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> in cake 1.3 you can alter $this->data in the beforeFilter of the controller
>
> in 2.0 $this->data is read only.
>
> writing a cake behaviour for the model may be what your looking for
>
>  - S
>
> On 8 August 2011 19:48, Johkke <gybels.j...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Is it possible to replace empty fields with an given string (like: 'No
> > subject given') at model or controller level? I really like to keep
> > the view as simple as possible
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to