Skip to content

Commit

Permalink
#10 -- Added Arr:remove for selects, radio groups and checkbox groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Grasseh committed Jul 28, 2016
1 parent e9f6785 commit 63b5a42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/anekdotes/Controls/CheckboxGroup.php
Expand Up @@ -37,6 +37,8 @@ public function prepare($arguments)
$values = (array) $values;
$hKey = Arr::get($opts, 'key', 'id');
$hValue = Arr::get($opts, 'value', 'name');
Arr::remove('key', $opts);
Arr::remove('value', $opts);
$html = '';
foreach ($elements as $element) {
$html .= '<div class="checkbox">';
Expand Down
2 changes: 2 additions & 0 deletions src/anekdotes/Controls/RadioGroup.php
Expand Up @@ -37,6 +37,8 @@ public function prepare($arguments)
$values = (array) $values;
$hKey = Arr::get($opts, 'key', 'id');
$hValue = Arr::get($opts, 'value', 'name');
Arr::remove('key', $opts);
Arr::remove('value', $opts);
$html = '';
foreach ($elements as $element) {
$html .= '<div class="radio">';
Expand Down
2 changes: 2 additions & 0 deletions src/anekdotes/Controls/Select.php
Expand Up @@ -39,6 +39,8 @@ public function prepare($arguments)
$values = (array) $values;
$hKey = Arr::get($opts, 'key', 'id');
$hValue = Arr::get($opts, 'value', 'name');
Arr::remove('key', $opts);
Arr::remove('value', $opts);
$html = '<select name="'.$name.'" '.$this->getOpts($opts).'>';
if ($placeholder != '') {
$option = new Option();
Expand Down

0 comments on commit 63b5a42

Please sign in to comment.