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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
f70e7bdf
Commit
f70e7bdf
authored
Jun 23, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4024 from umneeq/yii-bootstrap-tabs-enh
Added ability to `yii\bootstrap\Tabs` to encode each `Tabs::items['label']` separately
parents
9637fa1d
8f914bec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
CHANGELOG.md
extensions/bootstrap/CHANGELOG.md
+1
-1
Tabs.php
extensions/bootstrap/Tabs.php
+6
-3
No files found.
extensions/bootstrap/CHANGELOG.md
View file @
f70e7bdf
...
@@ -7,9 +7,9 @@ Yii Framework 2 bootstrap extension Change Log
...
@@ -7,9 +7,9 @@ Yii Framework 2 bootstrap extension Change Log
-
Bug #3292: Fixed dropdown widgets rendering incorrect HTML (it3rmit)
-
Bug #3292: Fixed dropdown widgets rendering incorrect HTML (it3rmit)
-
Bug #3740: Fixed duplicate error message when client validation is enabled (tadaszelvys)
-
Bug #3740: Fixed duplicate error message when client validation is enabled (tadaszelvys)
-
Bug #3749: Fixed invalid plugin registration and ensure clickable links in dropdown (kartik-v)
-
Bug #3749: Fixed invalid plugin registration and ensure clickable links in dropdown (kartik-v)
-
Enh #4024: Added ability to
`yii\bootstrap\Tabs`
to encode each
`Tabs::items['label']`
separately (creocoder, umneeq)
-
Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue)
-
Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue)
2.
0.0-beta April 13, 2014
2.
0.0-beta April 13, 2014
-------------------------
-------------------------
...
...
extensions/bootstrap/Tabs.php
View file @
f70e7bdf
...
@@ -58,13 +58,15 @@ class Tabs extends Widget
...
@@ -58,13 +58,15 @@ class Tabs extends Widget
* tab with the following structure:
* tab with the following structure:
*
*
* - label: string, required, the tab header label.
* - label: string, required, the tab header label.
* - encode: boolean, optional, whether this label should be HTML-encoded. This param will override
* global `$this->encodeLabels` param.
* - headerOptions: array, optional, the HTML attributes of the tab header.
* - headerOptions: array, optional, the HTML attributes of the tab header.
* - linkOptions: array, optional, the HTML attributes of the tab header link tags.
* - 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.
* - content:
string
, required if `items` is not set. The content (HTML) of the tab pane.
* - options: array, optional, the HTML attributes of the tab pane container.
* - 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.
* - active: boolean, optional, whether the item tab header and pane should be visible or not.
* - items: array, optional, if not set then `content` will be required. The `items` specify a dropdown items
* - items: array, optional, if not set then `content` will be required. The `items` specify a dropdown items
* configuration array. Each item can hold t
wo
extra keys, besides the above ones:
* configuration array. Each item can hold t
hree
extra keys, besides the above ones:
* * active: boolean, optional, whether the item tab header and pane should be visible or not.
* * active: boolean, optional, whether the item tab header and pane should be visible or not.
* * content: string, required if `items` is not set. The content (HTML) of the tab pane.
* * content: string, required if `items` is not set. The content (HTML) of the tab pane.
* * contentOptions: optional, array, the HTML attributes of the tab content container.
* * contentOptions: optional, array, the HTML attributes of the tab content container.
...
@@ -136,7 +138,8 @@ class Tabs extends Widget
...
@@ -136,7 +138,8 @@ class Tabs extends Widget
if
(
!
isset
(
$item
[
'label'
]))
{
if
(
!
isset
(
$item
[
'label'
]))
{
throw
new
InvalidConfigException
(
"The 'label' option is required."
);
throw
new
InvalidConfigException
(
"The 'label' option is required."
);
}
}
$label
=
$this
->
encodeLabels
?
Html
::
encode
(
$item
[
'label'
])
:
$item
[
'label'
];
$encodeLabel
=
$this
->
encodeLabels
||
isset
(
$item
[
'encode'
])
&&
$item
[
'encode'
]
===
true
;
$label
=
$encodeLabel
?
Html
::
encode
(
$item
[
'label'
])
:
$item
[
'label'
];
$headerOptions
=
array_merge
(
$this
->
headerOptions
,
ArrayHelper
::
getValue
(
$item
,
'headerOptions'
,
[]));
$headerOptions
=
array_merge
(
$this
->
headerOptions
,
ArrayHelper
::
getValue
(
$item
,
'headerOptions'
,
[]));
$linkOptions
=
array_merge
(
$this
->
linkOptions
,
ArrayHelper
::
getValue
(
$item
,
'linkOptions'
,
[]));
$linkOptions
=
array_merge
(
$this
->
linkOptions
,
ArrayHelper
::
getValue
(
$item
,
'linkOptions'
,
[]));
...
...
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