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
95aba6a2
Commit
95aba6a2
authored
Dec 19, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
e1d09a15
c493803a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
29 deletions
+55
-29
Bootstrap.php
components/Bootstrap.php
+5
-1
styles.css
demo/css/styles.css
+1
-0
styles.less
demo/less/styles.less
+4
-0
setup.php
demo/protected/views/site/setup.php
+32
-24
BootstrapCode.php
gii/bootstrap/BootstrapCode.php
+1
-1
TbAlert.php
widgets/TbAlert.php
+1
-1
TbButton.php
widgets/TbButton.php
+10
-1
TbModal.php
widgets/TbModal.php
+1
-1
No files found.
components/Bootstrap.php
View file @
95aba6a2
...
@@ -34,6 +34,10 @@ class Bootstrap extends CApplicationComponent
...
@@ -34,6 +34,10 @@ class Bootstrap extends CApplicationComponent
* @since 0.9.8
* @since 0.9.8
*/
*/
public
$plugins
=
array
();
public
$plugins
=
array
();
/**
* @var boolean indicates whether assets should be republished on every request.
*/
public
$publishAssets
=
YII_DEBUG
;
protected
$_assetsUrl
;
protected
$_assetsUrl
;
...
@@ -296,7 +300,7 @@ class Bootstrap extends CApplicationComponent
...
@@ -296,7 +300,7 @@ class Bootstrap extends CApplicationComponent
else
else
{
{
$assetsPath
=
Yii
::
getPathOfAlias
(
'bootstrap.assets'
);
$assetsPath
=
Yii
::
getPathOfAlias
(
'bootstrap.assets'
);
$assetsUrl
=
Yii
::
app
()
->
assetManager
->
publish
(
$assetsPath
,
true
,
-
1
,
YII_DEBUG
);
$assetsUrl
=
Yii
::
app
()
->
assetManager
->
publish
(
$assetsPath
,
true
,
-
1
,
$this
->
publishAssets
);
return
$this
->
_assetsUrl
=
$assetsUrl
;
return
$this
->
_assetsUrl
=
$assetsUrl
;
}
}
}
}
...
...
demo/css/styles.css
View file @
95aba6a2
...
@@ -219,6 +219,7 @@ p {
...
@@ -219,6 +219,7 @@ p {
padding
:
6px
0
;
padding
:
6px
0
;
}
}
.subnav.navbar-fixed-top
{
top
:
40px
;
}
.subnav.navbar-fixed-top
{
top
:
40px
;
}
.donate
h3
{
margin-top
:
0
;
}
footer
.powered
{
footer
.powered
{
color
:
#888888
;
color
:
#888888
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
...
...
demo/less/styles.less
View file @
95aba6a2
...
@@ -42,6 +42,10 @@ p {
...
@@ -42,6 +42,10 @@ p {
top: 40px;
top: 40px;
}
}
.donate h3 {
margin-top: 0;
}
footer {
footer {
.powered {
.powered {
color: #888;
color: #888;
...
...
demo/protected/views/site/setup.php
View file @
95aba6a2
...
@@ -13,41 +13,49 @@ $this->addMetaProperty('fb:app_id', Yii::app()->fb->appID);
...
@@ -13,41 +13,49 @@ $this->addMetaProperty('fb:app_id', Yii::app()->fb->appID);
<h2>
Setup
</h2>
<h2>
Setup
</h2>
<p>
Download the latest release
.
</p>
<p>
Download the latest release
from Yii extensions by following the link below:
</p>
<p>
<p>
<?php
echo
CHtml
::
link
(
'<i class="icon-share icon-white"></i> Get Yii-Bootstrap from Yii extensions'
,
<?php
$this
->
widget
(
'bootstrap.widgets.TbButton'
,
array
(
'http://www.yiiframework.com/extension/bootstrap/'
,
array
(
'class'
=>
'btn btn-primary btn-large'
,
'target'
=>
'_blank'
));
?>
'type'
=>
'primary'
,
'size'
=>
'large'
,
'icon'
=>
'download-alt white'
,
'label'
=>
'Download Yii-Bootstrap'
,
'url'
=>
'http://www.yiiframework.com/extension/bootstrap/'
,
'htmlOptions'
=>
array
(
'target'
=>
'_blank'
),
));
?>
</p>
</p>
<p>
Unzip the extension under
<strong>
protected/extensions/bootstrap
</strong>
and add the following code to your application configuration:
</p>
<p>
Unzip the extension under
<strong>
protected/extensions/bootstrap
</strong>
and modify your application configuration accordingly:
</p>
<p>
If you wish to use the provided Bootstrap theme copy the
<strong>
theme
</strong>
directory to your themes directory.
</p>
<?php
echo
$parser
->
safeTransform
(
"~~~
<?php
echo
$parser
->
safeTransform
(
"~~~
[php]
[php]
'preload'=>array(
// Define a path alias for the Bootstrap extension as it's used internally.
....
.
// In this example we assume that you unzipped the extension under protected/extensions
.
'bootstrap', // preload the bootstrap component
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
),
'modules'=>
array(
return
array(
.....
'theme'=>'bootstrap', // requires you to copy the theme under your themes directory
'gii
'=>array(
'modules
'=>array(
.....
'gii'=>array(
'generatorPaths'=>array(
'generatorPaths'=>array(
'bootstrap.gii',
'bootstrap.gii',
),
),
),
),
),
),
'components'=>array(
'components'=>array(
.....
'bootstrap'=>array(
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
),
),
),
)
,
)
;
~~~"
);
?>
~~~"
);
?>
<p>
<p>
You're done! Now you can start using Bootstrap in your application. For examples on how to use the widgets please visit the
You're done! Now you can start using Bootstrap in your application. For examples on how to use the widgets please visit the
<?php
echo
CHtml
::
link
(
'd
emo page
'
,
array
(
'site/index'
));
?>
.
<?php
echo
CHtml
::
link
(
'd
ocs
'
,
array
(
'site/index'
));
?>
.
</p>
</p>
</section>
</section>
...
...
gii/bootstrap/BootstrapCode.php
View file @
95aba6a2
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
Yii
::
import
(
'gii.generators.crud.CrudCode'
);
Yii
::
import
(
'gii.generators.crud.CrudCode'
);
class
BootstrapCode
extend
S
CrudCode
class
BootstrapCode
extend
s
CrudCode
{
{
public
function
generateActiveRow
(
$modelClass
,
$column
)
public
function
generateActiveRow
(
$modelClass
,
$column
)
{
{
...
...
widgets/TbAlert.php
View file @
95aba6a2
...
@@ -116,7 +116,7 @@ class TbAlert extends CWidget
...
@@ -116,7 +116,7 @@ class TbAlert extends CWidget
if
(
$this
->
closeText
!==
false
&&
!
isset
(
$alert
[
'closeText'
]))
if
(
$this
->
closeText
!==
false
&&
!
isset
(
$alert
[
'closeText'
]))
$alert
[
'closeText'
]
=
$this
->
closeText
;
$alert
[
'closeText'
]
=
$this
->
closeText
;
if
(
$alert
[
'closeText'
]
!==
false
)
if
(
isset
(
$alert
[
'closeText'
])
&&
$alert
[
'closeText'
]
!==
false
)
echo
'<a class="close" data-dismiss="alert">'
.
$alert
[
'closeText'
]
.
'</a>'
;
echo
'<a class="close" data-dismiss="alert">'
.
$alert
[
'closeText'
]
.
'</a>'
;
echo
Yii
::
app
()
->
user
->
getFlash
(
$type
);
echo
Yii
::
app
()
->
user
->
getFlash
(
$type
);
...
...
widgets/TbButton.php
View file @
95aba6a2
...
@@ -23,6 +23,8 @@ class TbButton extends CWidget
...
@@ -23,6 +23,8 @@ class TbButton extends CWidget
const
BUTTON_AJAXLINK
=
'ajaxLink'
;
const
BUTTON_AJAXLINK
=
'ajaxLink'
;
const
BUTTON_AJAXBUTTON
=
'ajaxButton'
;
const
BUTTON_AJAXBUTTON
=
'ajaxButton'
;
const
BUTTON_AJAXSUBMIT
=
'ajaxSubmit'
;
const
BUTTON_AJAXSUBMIT
=
'ajaxSubmit'
;
const
BUTTON_INPUTBUTTON
=
'inputButton'
;
const
BUTTON_INPUTSUBMIT
=
'inputSubmit'
;
// Button types.
// Button types.
const
TYPE_PRIMARY
=
'primary'
;
const
TYPE_PRIMARY
=
'primary'
;
...
@@ -232,12 +234,19 @@ class TbButton extends CWidget
...
@@ -232,12 +234,19 @@ class TbButton extends CWidget
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
case
self
::
BUTTON_AJAXSUBMIT
:
case
self
::
BUTTON_AJAXSUBMIT
:
$this
->
ajaxOptions
[
'type'
]
=
'POST'
;
$this
->
ajaxOptions
[
'type'
]
=
isset
(
$this
->
ajaxOptions
[
'type'
])
?
$this
->
ajaxOptions
[
'type'
]
:
'POST'
;
$this
->
ajaxOptions
[
'url'
]
=
$this
->
url
;
$this
->
ajaxOptions
[
'url'
]
=
$this
->
url
;
$this
->
htmlOptions
[
'type'
]
=
'submit'
;
$this
->
htmlOptions
[
'type'
]
=
'submit'
;
$this
->
htmlOptions
[
'ajax'
]
=
$this
->
ajaxOptions
;
$this
->
htmlOptions
[
'ajax'
]
=
$this
->
ajaxOptions
;
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
case
self
::
BUTTON_INPUTBUTTON
:
return
CHtml
::
button
(
$this
->
label
,
$this
->
htmlOptions
);
case
self
::
BUTTON_INPUTSUBMIT
:
$this
->
htmlOptions
[
'type'
]
=
'submit'
;
return
CHtml
::
button
(
$this
->
label
,
$this
->
htmlOptions
);
default
:
default
:
case
self
::
BUTTON_LINK
:
case
self
::
BUTTON_LINK
:
return
CHtml
::
link
(
$this
->
label
,
$this
->
url
,
$this
->
htmlOptions
);
return
CHtml
::
link
(
$this
->
label
,
$this
->
url
,
$this
->
htmlOptions
);
...
...
widgets/TbModal.php
View file @
95aba6a2
...
@@ -46,7 +46,7 @@ class TbModal extends CWidget
...
@@ -46,7 +46,7 @@ class TbModal extends CWidget
if
(
$this
->
autoOpen
===
false
&&
!
isset
(
$this
->
options
[
'show'
]))
if
(
$this
->
autoOpen
===
false
&&
!
isset
(
$this
->
options
[
'show'
]))
$this
->
options
[
'show'
]
=
false
;
$this
->
options
[
'show'
]
=
false
;
$classes
=
array
(
'modal'
);
$classes
=
array
(
'modal
hide
'
);
if
(
$this
->
fade
===
true
)
if
(
$this
->
fade
===
true
)
$classes
[]
=
'fade'
;
$classes
[]
=
'fade'
;
...
...
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