Re: Best Practice: Views, renderElement

2007-11-21 Thread RichardAtHome
Put your element code in app/view/elements and you can display them with: echo $this-renderElement(element_name); On Nov 21, 8:52 am, releod [EMAIL PROTECTED] wrote: Hello, I am wondering if there is a better approach to this built into CakePHP 1.2 Basically I have a few views,

Re: Best Practice: Views, renderElement

2007-11-21 Thread grigri
From my understanding, if you have a form (or any other chunk of html) that is used by several views, then it clearly qualifies as an element. Sure, it's a private element (only used by views in /user), but still an element. You could always create subfolders under the elements folder, so you'd

Re: Best Practice: Views, renderElement

2007-11-21 Thread releod
Cool, thanks - makes sense. On Nov 21, 4:52 am, grigri [EMAIL PROTECTED] wrote: From my understanding, if you have a form (or any other chunk of html) that is used by several views, then it clearly qualifies as an element. Sure, it's a private element (only used by views in /user), but

Re: Best Practice: Views, renderElement

2007-11-21 Thread [EMAIL PROTECTED]
Another solution extend basic view class. ?php class ExView extends View { function renderPartial($name, $params = array(), $loadHelpers = false) { if ((strpos($name, '\\')===false) (strpos($name, '/')===false)) { $name = '..' . DS .

Re: Best Practice: Views, renderElement

2007-11-21 Thread releod
Where is the best place to keep files that extend the CORE CAKE Framework? On Nov 21, 10:30 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Another solution extend basic view class. ?php class ExView extends View { function renderPartial($name, $params = array(), $loadHelpers =

Re: Best Practice: Views, renderElement

2007-11-21 Thread [EMAIL PROTECTED]
In place where thay should be. For view class extensisions correct place is /app/views folder BTW: @grigri Your proposiiton need aditional manual work. We need to describe each subview folder in bootstrap or create aditional code that will take time.