Tuesday, April 28, 2009

Re: Cleaner display of related data in baked views? displayField?

On Tue, Apr 28, 2009 at 7:35 PM, geste <jim.hogan@gmail.com> wrote:
>
> Brian,
>
> Personally, I'll take your response to mean "I'm not out of my
> mind".

I'm not sure what you mean but I don't think either of us are out of
their mind. :-)

> Yes, time to leave scaffolding behind, but there were some helpful
> (and not always helpful) defaults like "show name value for FK id".

For sure. Scaffolding is a big head start. But it can only provide a
basic view and should be considered as a starting point. Not many
people are going to want to display the model's ID, for instance. Or
list paginated results in a table.

> Like you say, I don't want to add more data for no good reason.  I had
> some vague notion of a helper that would return "name-for-id" or some
> other way of reformatting FK IDs in a way that would be inheritable.
> But if there's no fault to find with just editing baked views to show
> view vars, then I will go with that.  Just figured I'd aske before I
> go back and rebake 35 unscaffolded views!

I think a helper for that would be a bit tricky and probably not worth
the effort. You'd have to pass it the name of the associated model and
the field name as well, for instance. Like I said, this sort of thing
would be best in afterFind() if it's done at all. That way, it can be
tailored to a specific model.

But, personally, I think simply using the associated array is much
more straightforward.

--~--~---------~--~----~------------~-------~--~----~
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: