Renaming "optional" to "placeholder" Re: #60
Signed-off-by: Adam Engebretson <adam@enge.me>
This commit is contained in:
1 parent
9c4fea1f04
commit
fb7693cf4b
2 files changed
+5
-5
No files matched your search
+3
-3
@@ -494,10 +494,10 @@ class FormBuilder {
|
|||||||
// all together into one single HTML element that can be put on the form.
|
// all together into one single HTML element that can be put on the form.
|
||||||
$html = [];
|
$html = [];
|
||||||
|
|
||||||
if(isset($options['optional']))
|
if(isset($options['placeholder']))
|
||||||
{
|
{
|
||||||
$html[] = $this->placeholderOption($options['optional'], $selected);
|
$html[] = $this->placeholderOption($options['placeholder'], $selected);
|
||||||
unset($options['optional']);
|
unset($options['placeholder']);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($list as $value => $display)
|
foreach($list as $value => $display)
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
|
|||||||
'size',
|
'size',
|
||||||
['L' => 'Large', 'S' => 'Small'],
|
['L' => 'Large', 'S' => 'Small'],
|
||||||
null,
|
null,
|
||||||
['optional' => 'Select One...']
|
['placeholder' => 'Select One...']
|
||||||
);
|
);
|
||||||
$this->assertEquals($select, '<select name="size"><option selected="selected">Select One...</option><option value="L">Large</option><option value="S">Small</option></select>');
|
$this->assertEquals($select, '<select name="size"><option selected="selected">Select One...</option><option value="L">Large</option><option value="S">Small</option></select>');
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
|
|||||||
'size',
|
'size',
|
||||||
['L' => 'Large', 'S' => 'Small'],
|
['L' => 'Large', 'S' => 'Small'],
|
||||||
'L',
|
'L',
|
||||||
['optional' => 'Select One...']
|
['placeholder' => 'Select One...']
|
||||||
);
|
);
|
||||||
$this->assertEquals($select, '<select name="size"><option>Select One...</option><option value="L" selected="selected">Large</option><option value="S">Small</option></select>');
|
$this->assertEquals($select, '<select name="size"><option>Select One...</option><option value="L" selected="selected">Large</option><option value="S">Small</option></select>');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user