Skip to content

Commit fb7693c

Browse files
committed
Renaming "optional" to "placeholder" Re: #60
Signed-off-by: Adam Engebretson <adam@enge.me>
1 parent 9c4fea1 commit fb7693c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/FormBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ public function select($name, $list = [], $selected = null, $options = [])
494494
// all together into one single HTML element that can be put on the form.
495495
$html = [];
496496

497-
if(isset($options['optional']))
497+
if(isset($options['placeholder']))
498498
{
499-
$html[] = $this->placeholderOption($options['optional'], $selected);
500-
unset($options['optional']);
499+
$html[] = $this->placeholderOption($options['placeholder'], $selected);
500+
unset($options['placeholder']);
501501
}
502502

503503
foreach($list as $value => $display)

tests/FormBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,15 @@ public function testFormWithOptionalPlaceholder()
320320
'size',
321321
['L' => 'Large', 'S' => 'Small'],
322322
null,
323-
['optional' => 'Select One...']
323+
['placeholder' => 'Select One...']
324324
);
325325
$this->assertEquals($select, '<select name="size"><option selected="selected">Select One...</option><option value="L">Large</option><option value="S">Small</option></select>');
326326

327327
$select = $this->formBuilder->select(
328328
'size',
329329
['L' => 'Large', 'S' => 'Small'],
330330
'L',
331-
['optional' => 'Select One...']
331+
['placeholder' => 'Select One...']
332332
);
333333
$this->assertEquals($select, '<select name="size"><option>Select One...</option><option value="L" selected="selected">Large</option><option value="S">Small</option></select>');
334334
}

0 commit comments

Comments
 (0)