Comments on “CakePHP: Adding Dynamic Content to Layouts” http://robwilkerson.org/2008/12/15/cakephp-mixing-dynamic-content-with-static/feed 2009-11-26T22:26:13-04:00 Chyrp CakePHP: Adding Dynamic Content to Layouts tag:robwilkerson.org,2009-11-26:/id/159//comment_14132 2009-11-26T22:26:13-04:00 2009-11-26T22:26:13-04:00 webgeeks http://www.boffinsbook.com/ <p>i am a newbie and could not understand more than few lines of code, further simplification will help..</p> CakePHP: Adding Dynamic Content to Layouts tag:robwilkerson.org,2008-12-22:/id/159//comment_3378 2008-12-22T08:12:33-04:00 2008-12-22T08:12:33-04:00 Rob Wilkerson http://robwilkerson.org <p>Great solution, Ник. I like your approach better than mine since it’s much more extensible. I only need menus in my layout, but that may not be the only place I’ll <em>ever</em> need them. Your solution gives me a lot more options.</p> <p>Don’t be shocked if I, um, borrow your approach. :-)</p> CakePHP: Adding Dynamic Content to Layouts tag:robwilkerson.org,2008-12-21:/id/159//comment_3339 2008-12-21T17:52:32-04:00 2008-12-20T17:38:48-04:00 Ник http://nik.chankov.net <p>Hi, I’ve wrote about this here: <a href="http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/</a> about an year ago. :)</p> <p>So basically we are using the same approach, but instead of element I am using Helper. I think that it’s more good looking, but it’s a matter of taste anyway.</p> CakePHP: Adding Dynamic Content to Layouts tag:robwilkerson.org,2008-12-18:/id/159//comment_3292 2008-12-18T17:37:54-04:00 2008-12-18T17:37:54-04:00 Rob Wilkerson http://robwilkerson.org <p>I actually think that there’s a pretty decent <em>amount</em> of documentation, my bitch at times is that it only covers the trivial cases. I often find myself wishing that it went one step further.</p> <p>I worry about bloat with Cake – it’s not a small footprint – but it seems pretty manageable. There’s a lot of stuff, but it’s pretty confined and it seems like I can use as much or as little I need without incurring too much of a performance hit if I’m carefule; I haven’t benchmarked anything, though.</p> <p>I’ll look into list(). If it does what you say, then I’m all about it. Thanks.</p> CakePHP: Adding Dynamic Content to Layouts tag:robwilkerson.org,2008-12-18:/id/159//comment_3291 2008-12-18T17:02:39-04:00 2008-12-18T17:02:39-04:00 Kyril Revels <p>Good solution, Rob. I’ve been using Cake for quite some time, and it’s flexibility definitely impresses me. My frustrations w/ Cake mainly come from the lack of solid online documentation rather than any beefs w/ the framework itself.</p> <p>One other thing: I think you might be able to remove your unobfuscateMenus() model method if you were to select from NavMenu using find(‘list’) rather than find(‘all’).</p> <p>The ‘list’ parameter has a nice little feature that will auto-index your results based on the primary key by default. If you wish to index on some other field you can specify it by using:</p> <p>NavMenu->find(‘list’, array(‘fields’ => array(‘NavMenu.indexfield’, ‘NavMenu.field1’, ‘NavMenu.fieldn’)));</p>