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
b44a2085
Commit
b44a2085
authored
Mar 20, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated gii templates (fixes #35)
parent
9248d8d8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
12 deletions
+22
-12
BootstrapCode.php
gii/bootstrap/BootstrapCode.php
+2
-1
BootstrapGenerator.php
gii/bootstrap/BootstrapGenerator.php
+2
-1
_form.php
gii/bootstrap/templates/default/_form.php
+7
-3
_search.php
gii/bootstrap/templates/default/_search.php
+7
-3
admin.php
gii/bootstrap/templates/default/admin.php
+2
-2
index.php
gii/bootstrap/templates/default/index.php
+1
-1
view.php
gii/bootstrap/templates/default/view.php
+1
-1
No files found.
gii/bootstrap/BootstrapCode.php
View file @
b44a2085
<?php
<?php
/**
/**
* Boot
Crud
Code class file.
* Boot
strap
Code class file.
* @author Christoffer Niska <ChristofferNiska@gmail.com>
* @author Christoffer Niska <ChristofferNiska@gmail.com>
* @copyright Copyright © Christoffer Niska 2011-
* @copyright Copyright © Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
*/
Yii
::
import
(
'gii.generators.crud.CrudCode'
);
Yii
::
import
(
'gii.generators.crud.CrudCode'
);
class
BootstrapCode
extendS
CrudCode
class
BootstrapCode
extendS
CrudCode
{
{
public
function
generateActiveRow
(
$modelClass
,
$column
)
public
function
generateActiveRow
(
$modelClass
,
$column
)
...
...
gii/bootstrap/BootstrapGenerator.php
View file @
b44a2085
<?php
<?php
/**
/**
* Boot
Crud
Generator class file.
* Boot
strap
Generator class file.
* @author Christoffer Niska <ChristofferNiska@gmail.com>
* @author Christoffer Niska <ChristofferNiska@gmail.com>
* @copyright Copyright © Christoffer Niska 2011-
* @copyright Copyright © Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
*/
Yii
::
import
(
'gii.generators.crud.CrudGenerator'
);
Yii
::
import
(
'gii.generators.crud.CrudGenerator'
);
class
BootstrapGenerator
extends
CrudGenerator
class
BootstrapGenerator
extends
CrudGenerator
{
{
public
$codeModel
=
'bootstrap.gii.bootstrap.BootstrapCode'
;
public
$codeModel
=
'bootstrap.gii.bootstrap.BootstrapCode'
;
...
...
gii/bootstrap/templates/default/_form.php
View file @
b44a2085
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* - $this: the BootCrudCode object
* - $this: the BootCrudCode object
*/
*/
?>
?>
<?php
echo
"<?php
\$
form=
\$
this->beginWidget('
ext.
bootstrap.widgets.BootActiveForm',array(
<?php
echo
"<?php
\$
form=
\$
this->beginWidget('bootstrap.widgets.BootActiveForm',array(
'id'=>'"
.
$this
->
class2id
(
$this
->
modelClass
)
.
"-form',
'id'=>'"
.
$this
->
class2id
(
$this
->
modelClass
)
.
"-form',
'enableAjaxValidation'=>false,
'enableAjaxValidation'=>false,
)); ?>
\n
"
;
?>
)); ?>
\n
"
;
?>
...
@@ -24,8 +24,11 @@ foreach($this->tableSchema->columns as $column)
...
@@ -24,8 +24,11 @@ foreach($this->tableSchema->columns as $column)
<?php
<?php
}
}
?>
?>
<div
class=
"actions"
>
<div
class=
"form-actions"
>
<?php
echo
"<?php echo CHtml::submitButton(
\$
model->isNewRecord ? 'Create' : 'Save',array('class'=>'btn primary')); ?>
\n
"
;
?>
<?php
echo
"<?php
\$
this->widget('bootstrap.widgets.BootButton', array(
'type'=>'primary',
'label'=>
\$
model->isNewRecord ? 'Create' : 'Save',
)); ?>
\n
"
;
?>
</div>
</div>
<?php
echo
"<?php
\$
this->endWidget(); ?>
\n
"
;
?>
<?php
echo
"<?php
\$
this->endWidget(); ?>
\n
"
;
?>
\ No newline at end of file
gii/bootstrap/templates/default/_search.php
View file @
b44a2085
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* - $this: the BootCrudCode object
* - $this: the BootCrudCode object
*/
*/
?>
?>
<?php
echo
"<?php
\$
form=
\$
this->beginWidget('
ext.
bootstrap.widgets.BootActiveForm',array(
<?php
echo
"<?php
\$
form=
\$
this->beginWidget('bootstrap.widgets.BootActiveForm',array(
'action'=>Yii::app()->createUrl(
\$
this->route),
'action'=>Yii::app()->createUrl(
\$
this->route),
'method'=>'get',
'method'=>'get',
)); ?>
\n
"
;
?>
)); ?>
\n
"
;
?>
...
@@ -18,8 +18,11 @@
...
@@ -18,8 +18,11 @@
<?php
echo
"<?php echo "
.
$this
->
generateActiveRow
(
$this
->
modelClass
,
$column
)
.
"; ?>
\n
"
;
?>
<?php
echo
"<?php echo "
.
$this
->
generateActiveRow
(
$this
->
modelClass
,
$column
)
.
"; ?>
\n
"
;
?>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
<div
class=
"actions"
>
<div
class=
"form-actions"
>
<?php
echo
"<?php echo CHtml::submitButton('Search',array('class'=>'btn primary')); ?>
\n
"
;
?>
<?php
echo
"<?php
\$
this->widget('bootstrap.widgets.BootButton', array(
'type'=>'primary',
'label'=>'Search',
)); ?>
\n
"
;
?>
</div>
</div>
<?php
echo
"<?php
\$
this->endWidget(); ?>
\n
"
;
?>
<?php
echo
"<?php
\$
this->endWidget(); ?>
\n
"
;
?>
\ No newline at end of file
gii/bootstrap/templates/default/admin.php
View file @
b44a2085
...
@@ -47,7 +47,7 @@ or <b>=</b>) at the beginning of each of your search values to specify how the c
...
@@ -47,7 +47,7 @@ or <b>=</b>) at the beginning of each of your search values to specify how the c
)); ?>
\n
"
;
?>
)); ?>
\n
"
;
?>
</div>
<!-- search-form -->
</div>
<!-- search-form -->
<?php
echo
"<?php"
;
?>
$this->widget('
ext.
bootstrap.widgets.BootGridView',array(
<?php
echo
"<?php"
;
?>
$this->widget('bootstrap.widgets.BootGridView',array(
'id'=>'
<?php
echo
$this
->
class2id
(
$this
->
modelClass
);
?>
-grid',
'id'=>'
<?php
echo
$this
->
class2id
(
$this
->
modelClass
);
?>
-grid',
'dataProvider'=>$model->search(),
'dataProvider'=>$model->search(),
'filter'=>$model,
'filter'=>$model,
...
@@ -64,7 +64,7 @@ if($count>=7)
...
@@ -64,7 +64,7 @@ if($count>=7)
echo
"
\t\t
*/
\n
"
;
echo
"
\t\t
*/
\n
"
;
?>
?>
array(
array(
'class'=>'
C
ButtonColumn',
'class'=>'
Boot
ButtonColumn',
),
),
),
),
)); ?>
)); ?>
gii/bootstrap/templates/default/index.php
View file @
b44a2085
...
@@ -20,7 +20,7 @@ $this->menu=array(
...
@@ -20,7 +20,7 @@ $this->menu=array(
<h1>
<?php
echo
$label
;
?>
</h1>
<h1>
<?php
echo
$label
;
?>
</h1>
<?php
echo
"<?php"
;
?>
$this->widget('
ext.
bootstrap.widgets.BootListView',array(
<?php
echo
"<?php"
;
?>
$this->widget('bootstrap.widgets.BootListView',array(
'dataProvider'=>$dataProvider,
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'itemView'=>'_view',
)); ?>
)); ?>
gii/bootstrap/templates/default/view.php
View file @
b44a2085
...
@@ -25,7 +25,7 @@ $this->menu=array(
...
@@ -25,7 +25,7 @@ $this->menu=array(
<h1>
View
<?php
echo
$this
->
modelClass
.
" #<?php echo
\$
model->
{
$this
->
tableSchema
->
primaryKey
}
; ?>"
;
?>
</h1>
<h1>
View
<?php
echo
$this
->
modelClass
.
" #<?php echo
\$
model->
{
$this
->
tableSchema
->
primaryKey
}
; ?>"
;
?>
</h1>
<?php
echo
"<?php"
;
?>
$this->widget('
ext.
bootstrap.widgets.BootDetailView',array(
<?php
echo
"<?php"
;
?>
$this->widget('bootstrap.widgets.BootDetailView',array(
'data'=>$model,
'data'=>$model,
'attributes'=>array(
'attributes'=>array(
<?php
<?php
...
...
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