Example #1
0
            </fieldset>
            <?php 
                $this->widget('bootstrap.widgets.TbListView', array('dataProvider' => $topicDataProvider, 'itemView' => '../_lovetopiclist', 'emptyText' => '<div class="alert alert-info">暂无关注的话题</div>', 'template' => '{items}{pager}', 'id' => 'topic-item', 'htmlOptions' => array('style' => 'padding-top:0px')));
                ?>
            <?php 
            } else {
                if ($_GET["type"] == "help" || $_GET["type"] == "forhelp") {
                    $requestModel = new Request();
                    if ($_GET["type"] == "help") {
                        $requestModel->delete_flag != 1;
                        $requestModel->to_user = Yii::app()->user->id;
                    } else {
                        $requestModel->delete_flag != 2;
                        $requestModel->create_user = Yii::app()->user->id;
                    }
                    $requestDataProvider = $requestModel->search();
                    ?>
            <fieldset>
                <legend><?php 
                    echo $_GET["type"] == "help" ? "邀请我" : "我邀请";
                    ?>
回答的问题(<span id="request-count"><?php 
                    echo $requestDataProvider->itemCount;
                    ?>
</span>)
                    <?php 
                    $this->widget('bootstrap.widgets.TbButtonGroup', array('toggle' => 'radio', 'size' => 'mini', 'buttons' => array(array('label' => '全部', 'buttonType' => 'link', 'active' => !isset($_GET['reply']) ? true : false, 'htmlOptions' => array('title' => '全部'), 'url' => $this->createUrl('index', array("type" => $_GET["type"]))), array('label' => '已回答', 'buttonType' => 'link', 'active' => isset($_GET['reply']) && $_GET['reply'] == 1 ? true : false, 'url' => $this->createUrl('index', array("type" => $_GET["type"], "reply" => 1)), 'htmlOptions' => array('title' => '未回答')), array('label' => '未回答', 'buttonType' => 'link', 'active' => isset($_GET['reply']) && $_GET['reply'] == 0 ? true : false, 'url' => $this->createUrl('index', array("type" => $_GET["type"], "reply" => 0)), 'htmlOptions' => array('title' => '未回答'))), 'htmlOptions' => array("class" => "pull-right", "style" => "margin-left:10px;")));
                    ?>

                </legend>
            </fieldset>
Example #2
0
 public function testSearch()
 {
     $_GET['q'] = 'Asdrubal';
     $this->assertEquals('Asdrubal', $this->object->search());
 }