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
420499f9
Commit
420499f9
authored
Mar 17, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added mini button support (fixes #31)
parent
90b00207
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
index.php
demo/protected/views/site/index.php
+17
-4
BootButton.php
widgets/BootButton.php
+2
-1
No files found.
demo/protected/views/site/index.php
View file @
420499f9
...
...
@@ -847,7 +847,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h2>
Buttons
</h2>
<div
class=
"row"
>
<div
class=
"span
4
"
>
<div
class=
"span
3
"
>
<h3>
Large
</h3>
<p>
<?php
$this
->
widget
(
'bootstrap.widgets.BootButton'
,
array
(
...
...
@@ -860,7 +860,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</p>
</div>
<div
class=
"span
4
"
>
<div
class=
"span
3
"
>
<h3>
Normal
</h3>
<p>
<?php
$this
->
widget
(
'bootstrap.widgets.BootButton'
,
array
(
...
...
@@ -873,7 +873,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</p>
</div>
<div
class=
"span
4
"
>
<div
class=
"span
3
"
>
<h3>
Small
</h3>
<p>
<?php
$this
->
widget
(
'bootstrap.widgets.BootButton'
,
array
(
...
...
@@ -885,6 +885,19 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
));
?>
</p>
</div>
<div
class=
"span3"
>
<h3>
Mini
</h3>
<p>
<?php
$this
->
widget
(
'bootstrap.widgets.BootButton'
,
array
(
'label'
=>
'Primary'
,
'type'
=>
'primary'
,
'size'
=>
'mini'
,
));
?>
<?php
$this
->
widget
(
'bootstrap.widgets.BootButton'
,
array
(
'label'
=>
'Action'
,
'size'
=>
'mini'
,
));
?>
</p>
</div>
</div>
<h4>
Source code
</h4>
...
...
@@ -895,7 +908,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php
\$
this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Primary',
'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'size'=>'
small', // '', 'small' or 'large
'
'size'=>'
large', // '', 'large', 'small' or 'mini
'
)); ?>
</p>
~~~"
);
?>
...
...
widgets/BootButton.php
View file @
420499f9
...
...
@@ -35,6 +35,7 @@ class BootButton extends BootWidget
const
TYPE_INVERSE
=
'inverse'
;
// Button sizes.
const
SIZE_MINI
=
'mini'
;
const
SIZE_SMALL
=
'small'
;
const
SIZE_NORMAL
=
''
;
const
SIZE_LARGE
=
'large'
;
...
...
@@ -113,7 +114,7 @@ class BootButton extends BootWidget
if
(
isset
(
$this
->
type
)
&&
in_array
(
$this
->
type
,
$validTypes
))
$class
[]
=
'btn-'
.
$this
->
type
;
$validSizes
=
array
(
self
::
SIZE_
SMALL
,
self
::
SIZE_LARGE
);
$validSizes
=
array
(
self
::
SIZE_
LARGE
,
self
::
SIZE_SMALL
,
self
::
SIZE_MINI
);
if
(
isset
(
$this
->
size
)
&&
in_array
(
$this
->
size
,
$validSizes
))
$class
[]
=
'btn-'
.
$this
->
size
;
...
...
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