Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
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
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
PSDI Army
yii2
Commits
b6b3e7fd
Commit
b6b3e7fd
authored
May 22, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #352 from creocoder/bootstrap-refactoring
`yii\bootstrap\*` another refactioring
parents
b317c082
c5e93efd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
Modal.php
framework/yii/bootstrap/Modal.php
+2
-2
TypeAhead.php
framework/yii/bootstrap/TypeAhead.php
+5
-6
Widget.php
framework/yii/bootstrap/Widget.php
+6
-6
No files found.
framework/yii/bootstrap/Modal.php
View file @
b6b3e7fd
...
...
@@ -217,9 +217,9 @@ class Modal extends Widget
),
$this
->
options
);
$this
->
addCssClass
(
$this
->
options
,
'modal'
);
$this
->
plugin
Options
=
array_merge
(
array
(
$this
->
client
Options
=
array_merge
(
array
(
'show'
=>
false
,
),
$this
->
plugin
Options
);
),
$this
->
client
Options
);
if
(
$this
->
closeButton
!==
null
)
{
$this
->
closeButton
=
array_merge
(
array
(
...
...
framework/yii/bootstrap/TypeAhead.php
View file @
b6b3e7fd
...
...
@@ -19,10 +19,9 @@ use yii\helpers\Html;
*
* ```php
* echo TypeAhead::widget(array(
* 'form' => $form,
* 'model' => $model,
* 'attribute' => 'country',
* '
plugin
Options' => array(
* '
client
Options' => array(
* 'source' => array('USA', 'ESP'),
* ),
* ));
...
...
@@ -33,7 +32,7 @@ use yii\helpers\Html;
* ```php
* echo TypeAhead::widget(array(
* 'name' => 'country',
* '
plugin
Options' => array(
* '
cloent
Options' => array(
* 'source' => array('USA', 'ESP'),
* ),
* ));
...
...
@@ -77,8 +76,8 @@ class TypeAhead extends Widget
* If [[model]] is null or not from an [[Model]] instance, then the field will be rendered according to
* the [[name]] attribute.
* @return string the rendering result
* @throws InvalidConfigException when none of the required attributes are set to render the textInput.
That is,
* if [[model]] and [[attribute]] are not set, then [[name]] is required.
* @throws InvalidConfigException when none of the required attributes are set to render the textInput.
*
That is,
if [[model]] and [[attribute]] are not set, then [[name]] is required.
*/
public
function
renderField
()
{
...
...
@@ -87,7 +86,7 @@ class TypeAhead extends Widget
}
elseif
(
$this
->
name
!==
null
)
{
return
Html
::
textInput
(
$this
->
name
,
$this
->
value
,
$this
->
options
);
}
else
{
throw
new
InvalidConfigException
(
'Either "name" or "model" and "attribute" properties must be specified.'
);
throw
new
InvalidConfigException
(
"Either 'name' or 'model' and 'attribute' properties must be specified."
);
}
}
}
framework/yii/bootstrap/Widget.php
View file @
b6b3e7fd
...
...
@@ -35,14 +35,14 @@ class Widget extends \yii\base\Widget
* For example, [this page](http://twitter.github.io/bootstrap/javascript.html#modals) shows
* how to use the "Modal" plugin and the supported options (e.g. "remote").
*/
public
$
plugin
Options
=
array
();
public
$
client
Options
=
array
();
/**
* @var array the event handlers for the underlying Bootstrap JS plugin.
* Please refer to the corresponding Bootstrap plugin Web page for possible events.
* For example, [this page](http://twitter.github.io/bootstrap/javascript.html#modals) shows
* how to use the "Modal" plugin and the supported events (e.g. "shown").
*/
public
$
plugin
Events
=
array
();
public
$
client
Events
=
array
();
/**
...
...
@@ -69,15 +69,15 @@ class Widget extends \yii\base\Widget
$view
->
registerAssetBundle
(
static
::
$responsive
?
'yii/bootstrap/responsive'
:
'yii/bootstrap'
);
$view
->
registerAssetBundle
(
"yii/bootstrap/
$name
"
);
if
(
$this
->
plugin
Options
!==
false
)
{
$options
=
empty
(
$this
->
pluginOptions
)
?
''
:
Json
::
encode
(
$this
->
plugin
Options
);
if
(
$this
->
client
Options
!==
false
)
{
$options
=
empty
(
$this
->
clientOptions
)
?
''
:
Json
::
encode
(
$this
->
client
Options
);
$js
=
"jQuery('#
$id
').
$name
(
$options
);"
;
$view
->
registerJs
(
$js
);
}
if
(
!
empty
(
$this
->
plugin
Events
))
{
if
(
!
empty
(
$this
->
client
Events
))
{
$js
=
array
();
foreach
(
$this
->
plugin
Events
as
$event
=>
$handler
)
{
foreach
(
$this
->
client
Events
as
$event
=>
$handler
)
{
$js
[]
=
"jQuery('#
$id
').on('
$event
',
$handler
);"
;
}
$view
->
registerJs
(
implode
(
"
\n
"
,
$js
));
...
...
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