Пример #1
0
<?php

/* @var $this FeedbackController */
/* @var $model Feedback */
$this->breadcrumbs = array('留言' => array('admin'), '管理留言');
$this->menu = array(array('label' => '管理留言', 'url' => array('admin'), 'active' => $this->action->id == 'admin'));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#feedback-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>




<?php 
echo CHtml::link('高级搜索', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'feedback-grid', 'summaryText' => false, 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'id', 'header' => '#', 'htmlOptions' => array('width' => 50)), array('name' => 'category', 'htmlOptions' => array('width' => 100), 'value' => '$data->categoryLookup()', 'filter' => Feedback::getAllCategory()), array('name' => 'name', 'htmlOptions' => array('width' => 100)), array('name' => 'status', 'htmlOptions' => array('width' => 100), 'value' => '$data->statusLookup()', 'filter' => Feedback::getAllStatus()), array('name' => 'content', 'value' => 'Fircms::truncate_utf8_string($data->content,50)'), array('name' => 'create_time', 'htmlOptions' => array('width' => 180), 'type' => 'datetime'), array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{update},{delete}'))));
?>

Пример #2
0
/* @var $model Feedback */
/* @var $form CActiveForm */
?>

<div class="wide form">

    <?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('layout' => TbHtml::FORM_LAYOUT_HORIZONTAL, 'action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
?>

    <?php 
echo $form->textFieldControlGroup($model, 'id');
?>

    <?php 
echo $form->dropDownListControlGroup($model, 'category', Feedback::getAllCategory());
?>

    <?php 
echo $form->dropDownListControlGroup($model, 'status', Feedback::getAllStatus());
?>

    <?php 
echo $form->textFieldControlGroup($model, 'name');
?>


    <?php 
echo $form->textFieldControlGroup($model, 'position');
?>