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
774ae2e1
Commit
774ae2e1
authored
Sep 17, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into new-asset
Conflicts: apps/basic/composer.json composer.json
parents
1ff89de2
a3ab453a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
ActiveField.php
ActiveField.php
+8
-2
ActiveForm.php
ActiveForm.php
+5
-3
No files found.
ActiveField.php
View file @
774ae2e1
...
@@ -248,10 +248,13 @@ class ActiveField extends \yii\widgets\ActiveField
...
@@ -248,10 +248,13 @@ class ActiveField extends \yii\widgets\ActiveField
}
}
if
(
!
isset
(
$options
[
'itemOptions'
]))
{
if
(
!
isset
(
$options
[
'itemOptions'
]))
{
$options
[
'itemOptions'
]
=
[
$options
[
'itemOptions'
]
=
[
'container'
=>
false
,
'labelOptions'
=>
[
'class'
=>
'checkbox-inline'
],
'labelOptions'
=>
[
'class'
=>
'checkbox-inline'
],
];
];
}
}
}
elseif
(
!
isset
(
$options
[
'item'
]))
{
$options
[
'item'
]
=
function
(
$index
,
$label
,
$name
,
$checked
,
$value
)
{
return
'<div class="checkbox">'
.
Html
::
checkbox
(
$name
,
$checked
,
[
'label'
=>
$label
,
'value'
=>
$value
])
.
'</div>'
;
};
}
}
parent
::
checkboxList
(
$items
,
$options
);
parent
::
checkboxList
(
$items
,
$options
);
return
$this
;
return
$this
;
...
@@ -271,10 +274,13 @@ class ActiveField extends \yii\widgets\ActiveField
...
@@ -271,10 +274,13 @@ class ActiveField extends \yii\widgets\ActiveField
}
}
if
(
!
isset
(
$options
[
'itemOptions'
]))
{
if
(
!
isset
(
$options
[
'itemOptions'
]))
{
$options
[
'itemOptions'
]
=
[
$options
[
'itemOptions'
]
=
[
'container'
=>
false
,
'labelOptions'
=>
[
'class'
=>
'radio-inline'
],
'labelOptions'
=>
[
'class'
=>
'radio-inline'
],
];
];
}
}
}
elseif
(
!
isset
(
$options
[
'item'
]))
{
$options
[
'item'
]
=
function
(
$index
,
$label
,
$name
,
$checked
,
$value
)
{
return
'<div class="radio">'
.
Html
::
radio
(
$name
,
$checked
,
[
'label'
=>
$label
,
'value'
=>
$value
])
.
'</div>'
;
};
}
}
parent
::
radioList
(
$items
,
$options
);
parent
::
radioList
(
$items
,
$options
);
return
$this
;
return
$this
;
...
...
ActiveForm.php
View file @
774ae2e1
...
@@ -65,6 +65,11 @@ use yii\base\InvalidConfigException;
...
@@ -65,6 +65,11 @@ use yii\base\InvalidConfigException;
*/
*/
class
ActiveForm
extends
\yii\widgets\ActiveForm
class
ActiveForm
extends
\yii\widgets\ActiveForm
{
{
/**
* @var string the default field class name when calling [[field()]] to create a new field.
* @see fieldConfig
*/
public
$fieldClass
=
'yii\bootstrap\ActiveField'
;
/**
/**
* @var array HTML attributes for the form tag. Default is `['role' => 'form']`.
* @var array HTML attributes for the form tag. Default is `['role' => 'form']`.
*/
*/
...
@@ -91,9 +96,6 @@ class ActiveForm extends \yii\widgets\ActiveForm
...
@@ -91,9 +96,6 @@ class ActiveForm extends \yii\widgets\ActiveForm
if
(
$this
->
layout
!==
'default'
)
{
if
(
$this
->
layout
!==
'default'
)
{
Html
::
addCssClass
(
$this
->
options
,
'form-'
.
$this
->
layout
);
Html
::
addCssClass
(
$this
->
options
,
'form-'
.
$this
->
layout
);
}
}
if
(
!
isset
(
$this
->
fieldConfig
[
'class'
]))
{
$this
->
fieldConfig
[
'class'
]
=
ActiveField
::
className
();
}
parent
::
init
();
parent
::
init
();
}
}
}
}
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