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
ba2f6bbb
Commit
ba2f6bbb
authored
Mar 19, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added bottom navbar support to BootNavbar
parent
9c7c9584
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
BootNavbar.php
widgets/BootNavbar.php
+20
-13
No files found.
widgets/BootNavbar.php
View file @
ba2f6bbb
...
...
@@ -15,6 +15,10 @@ Yii::import('bootstrap.widgets.BootWidget');
*/
class
BootNavbar
extends
BootWidget
{
// Navbar fix locations.
const
FIXED_TOP
=
'top'
;
const
FIXED_BOTTOM
=
'bottom'
;
/**
* @var string the text for the brand.
*/
...
...
@@ -33,15 +37,15 @@ class BootNavbar extends BootWidget
*/
public
$items
=
array
();
/**
* @var
boolean whether the nav span over the full width. Defaults to false
.
* @var
string fix location of the navbar if applicable. Valid values are 'top' and 'bottom'. Defaults to 'top'
.
* @since 0.9.8
*/
public
$f
luid
=
false
;
public
$f
ixed
=
self
::
FIXED_TOP
;
/**
* @var boolean whether the nav bar is fixed to the top of the page. Defaults to tru
e.
* @since 0.9.8
*/
public
$f
ixed
=
tru
e
;
* @var boolean whether the nav span over the full width. Defaults to fals
e.
* @since 0.9.8
*/
public
$f
luid
=
fals
e
;
/**
* @var boolean whether to enable collapsing on narrow screens. Default to false.
*/
...
...
@@ -70,15 +74,18 @@ class BootNavbar extends BootWidget
*/
public
function
run
()
{
if
(
isset
(
$this
->
htmlOptions
[
'class'
]))
$this
->
htmlOptions
[
'class'
]
.=
' navbar'
;
else
$this
->
htmlOptions
[
'class'
]
=
'navbar'
;
$class
=
array
(
'navbar'
);
$validFixes
=
array
(
self
::
FIXED_TOP
,
self
::
FIXED_BOTTOM
);
if
(
$this
->
fixed
)
$this
->
htmlOptions
[
'class'
]
.=
' navbar-fixed-top'
;
if
(
in_array
(
$this
->
fixed
,
$validFixes
))
$class
[]
=
'navbar-fixed-'
.
$this
->
fixed
;
$cssClass
=
implode
(
' '
,
$class
);
if
(
isset
(
$this
->
htmlOptions
[
'class'
]))
$this
->
htmlOptions
[
'class'
]
.=
' '
.
$cssClass
;
else
$this
->
htmlOptions
[
'class'
]
.=
' navbar-static'
;
$this
->
htmlOptions
[
'class'
]
=
$cssClass
;
if
(
isset
(
$this
->
brandOptions
[
'class'
]))
$this
->
brandOptions
[
'class'
]
.=
' brand'
;
...
...
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