ENHANCEMENT Form->formTemplate() - allow rendering with Form subclass template

MINOR code convention formatting

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56142 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-06-12 09:04:07 +00:00
parent f2bfbc652e
commit 7ec8c205f1

View File

@ -265,7 +265,6 @@ class Form extends ViewableData {
return $this->fields->dataFieldByName($name);
}
/**
* Return the form's action buttons - used by the templates
*
@ -309,7 +308,6 @@ class Form extends ViewableData {
$child = null;
}
}
}
/**
@ -403,13 +401,13 @@ class Form extends ViewableData {
* Returns the name of the form
*/
function FormName() {
return $this->class . '_' . str_replace('.','',$this->name);
return $this->class . '_' . str_replace('.', '', $this->name);
}
/**
* @return string
*/
function Name(){
function Name() {
return $this->name;
}
@ -692,14 +690,19 @@ class Form extends ViewableData {
}
/**
* Return a rendered version of this form.
*
* This also allows for subclasses of Form to have their own template,
* falling back to 'Form' if it doesn't exist.
*
* This is returned when you access a form as $FormObject rather than <% control FormObject %>
*/
function forTemplate() {
$form = $this->renderWith("Form");
return $form;
return $this->renderWith(array(
$this->class,
'Form'
));
}
/**