Can you show me the documentation that says you can set variables from an element to be used in the layout?
If something is wrongly documented the core team will gladly correct it, but remember an element is not a view ... whilst closely related to views, an element is not meant to interact with the layout. What may seem a simpler approach to you does not neccessarily equal a cleaner approach. You're changing the request and response process from: - Controller (recieves request) - Model (requests and processes relevant data) - Controller (passes data to view) - View (constructs view - should be doing minimal data processing) - View elements (passing data sent from model to view) - Layout (builds layout around view - should be doing even less data processing than view) - Layout elements (passing data sent from view to layout) to: - Controller (recieves request) - Model (requests and processes relevant data) - Controller (passes data to view) - View (bypass, as not building view) - View elements (bypass, as not building view) - Layout (builds layout around nothing as no view passed) - Loader elements (now you request and try to display all your data) Essentially, you are using elements in a non-conventional manner, then saying the documentation is wrong! HTH, Paul @phpMagpie On Sep 7, 4:03 pm, Xoubaman <xouba...@gmail.com> wrote: > I know it's possible to accomplish it like you said -and thanks for your > answers and efforts to help, by the way-, but the basis of my question is > why a documented view method it's not working as expected. > > I was trying my approach because I think it would be simplier and cleaner, > to an unexperienced Cake user, edit or create layouts if he only have to > echo a var instead an element with passed params. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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