On Nov 20, 10:14 pm, aranworld <[EMAIL PROTECTED]> wrote:
> I don't want to create an add or edit template for any of my
> controllers. Since my add and edit templates will just be pointers to
> a shared admin form (one of which I will create for each controller),
> they will all be identical. I want to just create 1 add.ctp and 1
> edit.ctp template for my entire application. Each of my view folders
> will contain a single form to be used for adding and editing. But I
> don't want these directories to contain either an edit or an add
> template file.
>
> Before coming up with something custom, I just wanted to make sure
> there wasn't already a cakephp way to share a single template file
> among all controllers in an application.
function admin_add() {
...
$this->render('/elements/edit');
}
function admin_edit($id) {
...
$this->render('/elements/edit');
}
// view /elements/edit.ctp
echo $form->create(null, array('url' => $this->passedArgs));
echo $form->inputs();
echo $form->submit();
echo $form->end();
Or something similar
hth
AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---