Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Fixed errors with combobox.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebronner committed Jul 14, 2020
1 parent 1fb2e5c commit dfbc869
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.12.4] - 2020-05-08
### Fixed
- errors with combobox.

## [0.12.3] - 2020-05-08
### Fixed
- population of selected value for combobox.
Expand Down
5 changes: 4 additions & 1 deletion src/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ public function switch($name, $value = 1, $checked = null, $options = [])

public function combobox(string $name, array $list = [], $selected = null, array $options = [], array $optionOptions = [])
{
if ($selected && $options["model"]) {
if ($selected
&& array_key_exists("model", $options)
&& $options["model"]
) {
$selected = (new $options["model"])->find($selected);
}

Expand Down

0 comments on commit dfbc869

Please sign in to comment.