Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

API FormField::name_to_label() for unlabelled fields

Will convert camel case to spaces, e.g. "TotalAmount"
to "Total Amount".
  • Loading branch information...
commit aa6f345d1d3f7887c359ff836aaadd5ec14942f6 1 parent 92e62eb
@howardgrigg howardgrigg authored chillu committed
Showing with 2 additions and 2 deletions.
  1. +1 −1  forms/FormField.php
  2. +1 −1  tests/forms/FormTest.php
View
2  forms/FormField.php
@@ -125,7 +125,7 @@ public static function name_to_label($fieldName) {
*/
public function __construct($name, $title = null, $value = null) {
$this->name = $name;
- $this->title = ($title === null) ? $name : $title;
+ $this->title = ($title === null) ? self::name_to_label($name) : $title;
if($value !== NULL) $this->setValue($value);
View
2  tests/forms/FormTest.php
@@ -211,7 +211,7 @@ public function testSessionValidationMessage() {
$this->assertPartialMatchBySelector(
'#SomeRequiredField span.required',
array(
- '"SomeRequiredField" is required'
+ '"Some Required Field" is required'
),
'Required fields show a notification on field when left blank'
);
Please sign in to comment.
Something went wrong with that request. Please try again.