Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2bootstrap
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
yii2bootstrap
Commits
4dd9f52e
Commit
4dd9f52e
authored
Mar 30, 2016
by
Marco
Committed by
Alexander Makarov
Mar 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #126: `yii\bootstrap\ToggleButtonGroup` was unable to work without model
parent
e64170ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
CHANGELOG.md
CHANGELOG.md
+1
-1
ToggleButtonGroup.php
ToggleButtonGroup.php
+11
-3
No files found.
CHANGELOG.md
View file @
4dd9f52e
...
@@ -4,7 +4,7 @@ Yii Framework 2 bootstrap extension Change Log
...
@@ -4,7 +4,7 @@ Yii Framework 2 bootstrap extension Change Log
2.
0.7 under development
2.
0.7 under development
-----------------------
-----------------------
-
Bug #126:
`yii\bootstrap\ToggleButtonGroup`
was unable to work without model (makroxyz)
2.
0.6 March 17, 2016
2.
0.6 March 17, 2016
--------------------
--------------------
...
...
ToggleButtonGroup.php
View file @
4dd9f52e
...
@@ -72,9 +72,17 @@ class ToggleButtonGroup extends InputWidget
...
@@ -72,9 +72,17 @@ class ToggleButtonGroup extends InputWidget
}
}
switch
(
$this
->
type
)
{
switch
(
$this
->
type
)
{
case
'checkbox'
:
case
'checkbox'
:
return
Html
::
activeCheckboxList
(
$this
->
model
,
$this
->
attribute
,
$this
->
items
,
$this
->
options
);
if
(
$this
->
hasModel
())
{
return
Html
::
activeCheckboxList
(
$this
->
model
,
$this
->
attribute
,
$this
->
items
,
$this
->
options
);
}
else
{
return
Html
::
checkboxList
(
$this
->
name
,
$this
->
value
,
$this
->
items
,
$this
->
options
);
}
case
'radio'
:
case
'radio'
:
return
Html
::
activeRadioList
(
$this
->
model
,
$this
->
attribute
,
$this
->
items
,
$this
->
options
);
if
(
$this
->
hasModel
())
{
return
Html
::
activeRadioList
(
$this
->
model
,
$this
->
attribute
,
$this
->
items
,
$this
->
options
);
}
else
{
return
Html
::
radioList
(
$this
->
name
,
$this
->
value
,
$this
->
items
,
$this
->
options
);
}
default
:
default
:
throw
new
InvalidConfigException
(
"Unsupported type '
{
$this
->
type
}
'"
);
throw
new
InvalidConfigException
(
"Unsupported type '
{
$this
->
type
}
'"
);
}
}
...
@@ -104,4 +112,4 @@ class ToggleButtonGroup extends InputWidget
...
@@ -104,4 +112,4 @@ class ToggleButtonGroup extends InputWidget
}
}
return
Html
::
$type
(
$name
,
$checked
,
[
'label'
=>
$label
,
'labelOptions'
=>
$labelOptions
,
'value'
=>
$value
]);
return
Html
::
$type
(
$name
,
$checked
,
[
'label'
=>
$label
,
'labelOptions'
=>
$labelOptions
,
'value'
=>
$value
]);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment