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 still an element. > > You could always create subfolders under the elements folder, so you'd > have $this->renderElement('user/admin_form'); to render app/views/ > elements/user/admin_form.ctp. > > If that seems odd to you, try creating an 'elements' subfolder under > app/views/user/, then registering app/views/user as a view path (in > bootstrap.php), so that View::renderElement() will look there too. > That feels a bit hacky, but should work. > > 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, admin_create, admin_update, > > admin_destroy, all using the same code for the form. > > I have created another view file called _admin_form.ctp > > > Right now, for example, I write: > > $this->renderElement('../user/_admin_form'); > > > inside of my admin_create.ctp, is there anyway to > > render('_admin_form'); without needing to jump out of the current > > directory? (_admin_form is in the users directory along with the other > > views). > > > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---