Re: how to generate views for "recursive 2" associations?
On Feb 11, 12:18 pm, "die...@be" wrote: > I think I'll try to fix the code and file a bug/patch I fixed it :) https://trac.cakephp.org/ticket/6087 --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to generate views for "recursive 2" associations?
I've been going through the sources and I think I've found out why cake behaves like this. Check https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/console/libs/tasks/view.php#L372 It seems that here only first level associations are set, independent of any $recursive parameter. I think I'll try to fix the code and file a bug/patch --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to generate views for "recursive 2" associations?
On Jan 26, 4:52 pm, RoVo wrote: > Hi Dieter, > > an example. We have 3 models (HABTM): > Posts <-> PostsTag <-> Tag > > If I bake only Posts and Tag (model, controller and views), I get a > results like yours . NO related Tags > > NOW I bake the PostsTag-model with belongsTo Post and belongsTo Tag. > If I bake the Post-controller and views again... > UUPS!?! > Related Tags are in the view.ctp :) Do you mean related "PostTag"s ? I really don't understand how to get any associatons other then direct ones when baking. Even when I set $var recursive = 3; in the model, and $this->model- >recursive = 3; in all functions of the controller, when I do "print_r ($associations); die();" in the view.ctp template, I only see the direct associatons. also, in the default view.ctp template only $associations ['hasAndBelongsToMany'], $associations['hasMany']. $associations ['belongsTo'] and $associations['hasOne'] are iterated, not the elements of their elements (eg 2nd level associatons). I wouldn't mind writing the code for this myself, if only $associations would contain the metadata (fields etc) of 2nd level associatons. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to generate views for "recursive 2" associations?
Hi Dieter, an example. We have 3 models (HABTM): Posts <-> PostsTag <-> Tag If I bake only Posts and Tag (model, controller and views), I get a results like yours . NO related Tags NOW I bake the PostsTag-model with belongsTo Post and belongsTo Tag. If I bake the Post-controller and views again... UUPS!?! Related Tags are in the view.ctp :) Tested with 1.2.1.8004 Hope that helps RoVo --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to generate views for "recursive 2" associations?
Hi, I'm try to bake views which also show associated items of the associated items I'm showing. The problem is, I can't find any variable in the bake template that tells me anything about these "2nd level" associations. Eg after setting var $recursive = 2; in the model, or $this->Model- >recursive = 2; in the controller, I do get the data available in the view, but i want these views be generated. in the bake template (eg /templates/views/view.ctp ) when I print_r ($associations) I only see info about the "first level" associations. Any ideas how to do this? thanks, Dieter --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---