Commit b44a2085 by Crisu83

updated gii templates (fixes #35)

parent 9248d8d8
<?php
/**
* BootCrudCode class file.
* BootstrapCode class file.
* @author Christoffer Niska <ChristofferNiska@gmail.com>
* @copyright Copyright &copy; Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
Yii::import('gii.generators.crud.CrudCode');
class BootstrapCode extendS CrudCode
{
public function generateActiveRow($modelClass, $column)
......
<?php
/**
* BootCrudGenerator class file.
* BootstrapGenerator class file.
* @author Christoffer Niska <ChristofferNiska@gmail.com>
* @copyright Copyright &copy; Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
Yii::import('gii.generators.crud.CrudGenerator');
class BootstrapGenerator extends CrudGenerator
{
public $codeModel = 'bootstrap.gii.bootstrap.BootstrapCode';
......
......@@ -4,7 +4,7 @@
* - $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',
'enableAjaxValidation'=>false,
)); ?>\n"; ?>
......@@ -24,8 +24,11 @@ foreach($this->tableSchema->columns as $column)
<?php
}
?>
<div class="actions">
<?php echo "<?php echo CHtml::submitButton(\$model->isNewRecord ? 'Create' : 'Save',array('class'=>'btn primary')); ?>\n"; ?>
<div class="form-actions">
<?php echo "<?php \$this->widget('bootstrap.widgets.BootButton', array(
'type'=>'primary',
'label'=>\$model->isNewRecord ? 'Create' : 'Save',
)); ?>\n"; ?>
</div>
<?php echo "<?php \$this->endWidget(); ?>\n"; ?>
\ No newline at end of file
......@@ -4,7 +4,7 @@
* - $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),
'method'=>'get',
)); ?>\n"; ?>
......@@ -18,8 +18,11 @@
<?php echo "<?php echo ".$this->generateActiveRow($this->modelClass,$column)."; ?>\n"; ?>
<?php endforeach; ?>
<div class="actions">
<?php echo "<?php echo CHtml::submitButton('Search',array('class'=>'btn primary')); ?>\n"; ?>
<div class="form-actions">
<?php echo "<?php \$this->widget('bootstrap.widgets.BootButton', array(
'type'=>'primary',
'label'=>'Search',
)); ?>\n"; ?>
</div>
<?php echo "<?php \$this->endWidget(); ?>\n"; ?>
\ No newline at end of file
......@@ -47,7 +47,7 @@ or <b>=</b>) at the beginning of each of your search values to specify how the c
)); ?>\n"; ?>
</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',
'dataProvider'=>$model->search(),
'filter'=>$model,
......@@ -64,7 +64,7 @@ if($count>=7)
echo "\t\t*/\n";
?>
array(
'class'=>'CButtonColumn',
'class'=>'BootButtonColumn',
),
),
)); ?>
......@@ -20,7 +20,7 @@ $this->menu=array(
<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,
'itemView'=>'_view',
)); ?>
......@@ -25,7 +25,7 @@ $this->menu=array(
<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,
'attributes'=>array(
<?php
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment