本文整理汇总了PHP中Links::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Links::unsetAttributes方法的具体用法?PHP Links::unsetAttributes怎么用?PHP Links::unsetAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Links
的用法示例。
在下文中一共展示了Links::unsetAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSearch
public function actionSearch($q = null)
{
$model = new Links();
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Links'])) {
$model->attributes = $_GET['Links'];
}
if ($q != null) {
$model->nome = $q;
}
$criteria = new CDbCriteria();
$criteria->addSearchCondition('t.nome', $model->nome, true, 'OR', 'ILIKE');
$criteria->addSearchCondition('t.tags', $model->nome, true, 'OR', 'ILIKE');
$criteria->addSearchCondition('t.descricao', $model->nome, true, 'OR', 'ILIKE');
$criteria->addSearchCondition('t.link', $model->nome, true, 'OR', 'ILIKE');
//
$criteria->order = 't.nome ASC';
$dataProvider = new CActiveDataProvider('Links', array('criteria' => $criteria, 'pagination' => array('pageSize' => 10)));
$this->render('index', array('dataProvider' => $dataProvider, 'model' => $model));
}
示例2: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Links('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Links'])) {
$model->attributes = $_GET['Links'];
}
$this->render('admin', array('model' => $model));
}
示例3: actionList_links
public function actionList_links()
{
if (Yii::app()->user->isGuest) {
$this->redirect($this->createAbsoluteUrl('default/index'));
}
$model = new Links('search');
$model->unsetAttributes();
if (isset($_GET['Links'])) {
$model->setAttributes($_GET['Links'], false);
}
$this->render('links/list_links', array('model' => $model));
}