Skip to content

Commit

Permalink
Updated Timezone.php with an optional placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranb committed Jul 21, 2014
1 parent a024155 commit 3caa171
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Camroncade/Timezone/Timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,14 @@ public function selectForm($selected = null, $placeholder = null, array $selectA

$string = "<select". $selectAttributesString .">\n";

if (isset($placeholder)) {
if (isset($placeholder) && (empty($selected)))
{
$placeholder = "<option value='' disabled selected>{$placeholder}</option>";
} else
{
}
else
{
$placeholder = null;
}
}

$string = $string . $placeholder;
foreach ($this->timezoneList as $key => $value)
Expand Down

0 comments on commit 3caa171

Please sign in to comment.