This is not a bug.  Unless the query generated includes a join to the
TemplateLayout model's table, then you cannot include those fields.
What associations are there between the three models?  Since Cake's
JOINS will only join a single association, it may be possible for you
to query the Layout model (with the Layout's section_id, if it has
one), and so in one query bring in the TemplateLayout.style.

But realistically, don't worry if your query also gets a few extra
fields.  I am sure that it will not be the performance bottleneck in
your application - and Cake is about building applications quickly (ie
code everything the simple / straightforward way - don't try to
"optimize" things that don't need to).

Since you say it works in recursive 2 these points probably just
relate to your poor posting style.

1.  What is with $this->controller->$model->Section ?  You should be
using just $this->Section in your controller
2.  If you want to bind Section to Layout, either do it in the
Section's inline associations, or if you must use bindModel, do it
properly:
$this->Section->bindModel( array(
  'hasMany'=>array(
    'Layout'=>array( 'className' => 'Layout' )
  )
) );


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