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
1bdb4695
Commit
1bdb4695
authored
May 13, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed an issue with displaying the BootBreadcrumbs homeLink
parent
56610a1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
BootBreadcrumbs.php
widgets/BootBreadcrumbs.php
+12
-12
No files found.
widgets/BootBreadcrumbs.php
View file @
1bdb4695
...
@@ -33,28 +33,28 @@ class BootBreadcrumbs extends CBreadcrumbs
...
@@ -33,28 +33,28 @@ class BootBreadcrumbs extends CBreadcrumbs
/**
/**
* Renders the content of the widget.
* Renders the content of the widget.
* @throws CException
*/
*/
public
function
run
()
public
function
run
()
{
{
if
(
empty
(
$this
->
links
))
return
;
$links
=
array
();
$links
=
array
();
if
(
!
isset
(
$this
->
homeLink
))
if
(
!
isset
(
$this
->
homeLink
))
$this
->
homeLink
=
array
(
'label'
=>
Yii
::
t
(
'bootstrap'
,
'Home'
),
'url'
=>
Yii
::
app
()
->
homeUrl
);
if
(
$this
->
homeLink
!==
false
)
{
{
if
(
is_array
(
$this
->
homeLink
))
$content
=
CHtml
::
link
(
Yii
::
t
(
'bootstrap'
,
'Home'
),
Yii
::
app
()
->
homeUrl
);
$this
->
homeLink
=
CHtml
::
link
(
$this
->
homeLink
[
'label'
],
$this
->
homeLink
[
'url'
]);
$links
[]
=
$this
->
renderItem
(
$content
);
$links
[]
=
$this
->
renderItem
(
$this
->
homeLink
,
Yii
::
app
()
->
request
->
requestUri
===
Yii
::
app
()
->
homeUrl
);
}
}
else
if
(
$this
->
homeLink
!==
false
)
foreach
(
$this
->
links
as
$label
=>
$url
)
$links
[]
=
$this
->
renderItem
(
$this
->
homeLink
);
foreach
(
$this
->
links
as
$label
=>
$url
)
{
{
if
(
is_string
(
$label
)
||
is_array
(
$url
))
if
(
is_string
(
$label
)
||
is_array
(
$url
))
{
{
$label
=
$this
->
encodeLabel
?
CHtml
::
encode
(
$label
)
:
$label
;
$content
=
CHtml
::
link
(
$this
->
encodeLabel
?
CHtml
::
encode
(
$label
)
:
$label
,
$url
);
$content
=
CHtml
::
link
(
$label
,
$url
);
$links
[]
=
$this
->
renderItem
(
$content
);
$links
[]
=
$this
->
renderItem
(
$content
);
}
}
else
else
...
@@ -72,7 +72,7 @@ class BootBreadcrumbs extends CBreadcrumbs
...
@@ -72,7 +72,7 @@ class BootBreadcrumbs extends CBreadcrumbs
* @param boolean $active whether the item is active.
* @param boolean $active whether the item is active.
* @return string the markup.
* @return string the markup.
*/
*/
protected
function
renderItem
(
$content
,
$active
=
false
)
protected
function
renderItem
(
$content
,
$active
=
false
)
{
{
$separator
=
!
$active
?
'<span class="divider">'
.
$this
->
separator
.
'</span>'
:
''
;
$separator
=
!
$active
?
'<span class="divider">'
.
$this
->
separator
.
'</span>'
:
''
;
...
...
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