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
54ea78d9
Commit
54ea78d9
authored
Feb 15, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1562: Added `yii\bootstrap\Tabs::linkOptions`
parent
26cb7b2a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
CHANGELOG.md
extensions/bootstrap/CHANGELOG.md
+1
-0
Tabs.php
extensions/bootstrap/Tabs.php
+12
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
No files found.
extensions/bootstrap/CHANGELOG.md
View file @
54ea78d9
...
...
@@ -8,6 +8,7 @@ Yii Framework 2 bootstrap extension Change Log
-
Enh #1474: Added option to make NavBar 100% width (cebe)
-
Enh #1552: It is now possible to use multiple bootstrap NavBar in a single page (Alex-Code)
-
Enh #1553: Only add navbar-default class to NavBar when no other class is specified (cebe)
-
Enh #1562: Added
`yii\bootstrap\Tabs::linkOptions`
(kartik-v)
-
Enh #1601: Added support for tagName and encodeLabel parameters in ButtonDropdown (omnilight)
-
Chg #1459: Update Collapse to use bootstrap 3 classes (tonydspaniard)
-
Chg #1820: Update Progress to use bootstrap 3 markup (samdark)
...
...
extensions/bootstrap/Tabs.php
View file @
54ea78d9
...
...
@@ -59,6 +59,7 @@ class Tabs extends Widget
*
* - label: string, required, the tab header label.
* - headerOptions: array, optional, the HTML attributes of the tab header.
* - linkOptions: array, optional, the HTML attributes of the tab header link tags.
* - content: array, required if `items` is not set. The content (HTML) of the tab pane.
* - options: array, optional, the HTML attributes of the tab pane container.
* - active: boolean, optional, whether the item tab header and pane should be visible or not.
...
...
@@ -82,6 +83,11 @@ class Tabs extends Widget
*/
public
$headerOptions
=
[];
/**
* @var array list of HTML attributes for the tab header link tags. This will be overwritten
* by the "linkOptions" set in individual [[items]].
*/
public
$linkOptions
=
[];
/**
* @var boolean whether the labels for header items should be HTML-encoded.
*/
public
$encodeLabels
=
true
;
...
...
@@ -124,6 +130,7 @@ class Tabs extends Widget
}
$label
=
$this
->
encodeLabels
?
Html
::
encode
(
$item
[
'label'
])
:
$item
[
'label'
];
$headerOptions
=
array_merge
(
$this
->
headerOptions
,
ArrayHelper
::
getValue
(
$item
,
'headerOptions'
,
[]));
$linkOptions
=
array_merge
(
$this
->
linkOptions
,
ArrayHelper
::
getValue
(
$item
,
'linkOptions'
,
[]));
if
(
isset
(
$item
[
'items'
]))
{
$label
.=
' <b class="caret"></b>'
;
...
...
@@ -133,7 +140,9 @@ class Tabs extends Widget
Html
::
addCssClass
(
$headerOptions
,
'active'
);
}
$header
=
Html
::
a
(
$label
,
"#"
,
[
'class'
=>
'dropdown-toggle'
,
'data-toggle'
=>
'dropdown'
])
.
"
\n
"
Html
::
addCssClass
(
$linkOptions
,
'dropdown-toggle'
);
$linkOptions
[
'data-toggle'
]
=
'dropdown'
;
$header
=
Html
::
a
(
$label
,
"#"
,
$linkOptions
)
.
"
\n
"
.
Dropdown
::
widget
([
'items'
=>
$item
[
'items'
],
'clientOptions'
=>
false
,
'view'
=>
$this
->
getView
()]);
}
elseif
(
isset
(
$item
[
'content'
]))
{
$options
=
array_merge
(
$this
->
itemOptions
,
ArrayHelper
::
getValue
(
$item
,
'options'
,
[]));
...
...
@@ -144,7 +153,8 @@ class Tabs extends Widget
Html
::
addCssClass
(
$options
,
'active'
);
Html
::
addCssClass
(
$headerOptions
,
'active'
);
}
$header
=
Html
::
a
(
$label
,
'#'
.
$options
[
'id'
],
[
'data-toggle'
=>
'tab'
]);
$linkOptions
[
'data-toggle'
]
=
'tab'
;
$header
=
Html
::
a
(
$label
,
'#'
.
$options
[
'id'
],
$linkOptions
);
$panes
[]
=
Html
::
tag
(
'div'
,
$item
[
'content'
],
$options
);
}
else
{
throw
new
InvalidConfigException
(
"Either the 'content' or 'items' option must be set."
);
...
...
framework/CHANGELOG.md
View file @
54ea78d9
...
...
@@ -67,6 +67,7 @@ Yii Framework 2 Change Log
-
Enh #1476: Add yii
\w
eb
\S
ession::handler property (nineinchnick)
-
Enh #1499: Added
`ActionColumn::controller`
property to support customizing the controller for handling GridView actions (qiangxue)
-
Enh #1523: Query conditions now allow to use the NOT operator (cebe)
-
Enh #1562: Added
`yii\bootstrap\Tabs::linkOptions`
(kartik-v)
-
Enh #1572: Added
`yii\web\Controller::createAbsoluteUrl()`
(samdark)
-
Enh #1579: throw exception when the given AR relation name does not match in a case sensitive manner (qiangxue)
-
Enh #1581: Added
`ActiveQuery::joinWith()`
and
`ActiveQuery::innerJoinWith()`
to support joining with relations (qiangxue)
...
...
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