I'm not certain if this is relevant, but I use a custom query in the
model -- that is, in the association within the model. Then I use
nothing special -- that is, I use FindAll without a custom query -- in
the controller. I then have my associated fields, as expected, in the
view, though I generally have to search around in the data object to
find out how to reference them from there.

Another very useful trick is to have one or more models based on
database VIEWs rather than on ordinary tables. Cake doesn't know the
difference, just treating the view as a table, and you can create the
view from any sort of query, EXCEPT one that uses the current record's
primary key -- ie., the view can't use {$__cakeID__$}, nor can it be
induced to use {$__cakeID__$} by supplying that as as part of a query
which refers to the view. (At first I imagined the latter method would
work, something like unification in Prolog, but no dice. SQL is not
that smart.)

To create a SQL view in MySQL, you need version 5.


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

Reply via email to