Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
Yii Bootstrap 3
Project
Overview
Details
Activity
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Common
Yii Bootstrap 3
Commits
436defd3
Commit
436defd3
authored
Apr 24, 2012
by
niskac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a bug that caused checkbox and radio attributes to be resolved twice (fixes #52)
parent
fc2d9ee0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
BootInputHorizontal.php
widgets/input/BootInputHorizontal.php
+8
-6
BootInputVertical.php
widgets/input/BootInputVertical.php
+6
-4
No files found.
widgets/input/BootInputHorizontal.php
View file @
436defd3
...
...
@@ -47,10 +47,11 @@ class BootInputHorizontal extends BootInput
*/
protected
function
checkBox
()
{
$attribute
=
$this
->
attribute
;
echo
'<div class="controls">'
;
echo
'<label class="checkbox" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$
this
->
attribute
))
.
'">'
;
echo
$this
->
form
->
checkBox
(
$this
->
model
,
$
this
->
attribute
,
$this
->
htmlOptions
)
.
PHP_EOL
;
echo
$this
->
model
->
getAttributeLabel
(
$
this
->
attribute
);
echo
'<label class="checkbox" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$attribute
))
.
'">'
;
echo
$this
->
form
->
checkBox
(
$this
->
model
,
$attribute
,
$this
->
htmlOptions
)
.
PHP_EOL
;
echo
$this
->
model
->
getAttributeLabel
(
$attribute
);
echo
$this
->
getError
()
.
$this
->
getHint
();
echo
'</label></div>'
;
}
...
...
@@ -123,10 +124,11 @@ class BootInputHorizontal extends BootInput
*/
protected
function
radioButton
()
{
$attribute
=
$this
->
attribute
;
echo
'<div class="controls">'
;
echo
'<label class="radio" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$
this
->
attribute
))
.
'">'
;
echo
$this
->
form
->
radioButton
(
$this
->
model
,
$
this
->
attribute
,
$this
->
htmlOptions
)
.
PHP_EOL
;
echo
$this
->
model
->
getAttributeLabel
(
$
this
->
attribute
);
echo
'<label class="radio" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$attribute
))
.
'">'
;
echo
$this
->
form
->
radioButton
(
$this
->
model
,
$attribute
,
$this
->
htmlOptions
)
.
PHP_EOL
;
echo
$this
->
model
->
getAttributeLabel
(
$attribute
);
echo
$this
->
getError
()
.
$this
->
getHint
();
echo
'</label></div>'
;
}
...
...
widgets/input/BootInputVertical.php
View file @
436defd3
...
...
@@ -34,9 +34,10 @@ class BootInputVertical extends BootInput
*/
protected
function
checkBox
()
{
echo
'<label class="checkbox" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$this
->
attribute
))
.
'">'
;
$attribute
=
$this
->
attribute
;
echo
'<label class="checkbox" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$attribute
))
.
'">'
;
echo
$this
->
form
->
checkBox
(
$this
->
model
,
$this
->
attribute
,
$this
->
htmlOptions
)
.
PHP_EOL
;
echo
$this
->
model
->
getAttributeLabel
(
$
this
->
attribute
);
echo
$this
->
model
->
getAttributeLabel
(
$attribute
);
echo
$this
->
getError
()
.
$this
->
getHint
();
echo
'</label>'
;
}
...
...
@@ -101,9 +102,10 @@ class BootInputVertical extends BootInput
*/
protected
function
radioButton
()
{
echo
'<label class="radio" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$this
->
attribute
))
.
'">'
;
$attribute
=
$this
->
attribute
;
echo
'<label class="radio" for="'
.
CHtml
::
getIdByName
(
CHtml
::
resolveName
(
$this
->
model
,
$attribute
))
.
'">'
;
echo
$this
->
form
->
radioButton
(
$this
->
model
,
$this
->
attribute
,
$this
->
htmlOptions
)
.
PHP_EOL
;
echo
$this
->
model
->
getAttributeLabel
(
$
this
->
attribute
);
echo
$this
->
model
->
getAttributeLabel
(
$attribute
);
echo
$this
->
getError
()
.
$this
->
getHint
();
echo
'</label>'
;
}
...
...
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