I'm new to Cake too, but this is one I believe I can answer.

As with many things, there is no right/wrong answer, but here's what I think
would be best.

Most logic should be kept in the Controller and just a data dump in the
view. So what you could do is populate your $this-data with the path for the
avatar and in your view, just display whatever dump an image tag regardless.

Of course you could just as easily check the data in the view before you
display with an "if", but convention would lean towards the former method.

On 7/12/07, Braindead <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I'm new to MVC development and at the moment I'm quiet unsure about V
> and C.
>
> Let's assume I have a list of users in which I want to display an
> avatar next to each user. If the user has no avatar I want to display
> the default one. Both, the user avatar and the default avatar, are
> stored in the filesystem.
>
> Here's my question: Where do I decide which avatar should be
> displayed? Is it C because it's some kind of logic? Or is it V because
> the avatar is part of the design?
>
> I'm unsure, because both would work, but I want to use the "correct"
> one.
>
> Thanks,
> Brain
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to