ContentList::search PHP Method

    public function search()
    {
        // Warning: Please modify the following code to remove attributes that
        // should not be searched.
        $criteria = new CDbCriteria();
        $criteria->compare('content_list_id', $this->content_list_id, true);
        $criteria->compare('name', $this->name, true);
        $criteria->compare('value', $this->value, true);
        $criteria->compare('created', $this->created);
        $sort = new CSort();
        $sort->attributes = array('content_list_id');
        $sort->defaultOrder = 'content_list_id DESC';
        return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => $sort));
    }

Usage Example

Esempio n. 1
0
<?php

//ini_set("display_errors" ,1 );
require_once $_SERVER['DOCUMENT_ROOT'] . '/../init.inc.php';
$params = 'zhao';
//搜索关键词
$indexSearch = ContentList::search($params);
Template::assign('indexType', $indexSearch);
Template::display('search.tpl');