當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Content::unsetAttributes方法代碼示例

本文整理匯總了PHP中Content::unsetAttributes方法的典型用法代碼示例。如果您正苦於以下問題:PHP Content::unsetAttributes方法的具體用法?PHP Content::unsetAttributes怎麽用?PHP Content::unsetAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Content的用法示例。


在下文中一共展示了Content::unsetAttributes方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionIndex

 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $this->addToolbar();
     $model = new Content('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Content'])) {
         $model->attributes = $_GET['Content'];
     }
     $this->render('index', array('model' => $model));
 }
開發者ID:nctruong,項目名稱:inputen,代碼行數:14,代碼來源:ContentController.php

示例2: actionIndex

 public function actionIndex()
 {
     if (Yii::app()->user->role == "moderator") {
         $this->redirect('admin/news');
     }
     $this->layout = '//layouts/admin';
     $this->pageTitle = 'Страницы контента';
     $this->breadcrumbs = array('Страницы контента');
     $model = new Content('search');
     $model->unsetAttributes();
     if (isset($_GET['Content'])) {
         $model->attributes = $_GET['Content'];
     }
     $this->render('index', array('model' => $model));
 }
開發者ID:42point,項目名稱:Vinum,代碼行數:15,代碼來源:DefaultController.php

示例3: actionIndex

 /**
  * Default management page
  * Display all items in a CListView for easy editing
  */
 public function actionIndex()
 {
     $preview = NULL;
     $model = new Content('search');
     $model->unsetAttributes();
     // clear any default values
     if (Cii::get($_GET, 'Content') !== NULL) {
         $model->attributes = $_GET['Content'];
     }
     // Only show posts that belong to that user if they are not an editor or an admin
     if ($role = Yii::app()->user->role) {
         if ($role != 7 && $role != 9) {
             $model->author_id = Yii::app()->user->id;
         }
     }
     if (Cii::get($_GET, 'id') !== NULL) {
         $preview = Content::model()->findByPk(Cii::get($_GET, 'id'));
     }
     $model->pageSize = 20;
     $this->render('index', array('model' => $model, 'preview' => $preview));
 }
開發者ID:fandikurnia,項目名稱:CiiMS,代碼行數:25,代碼來源:ContentController.php

示例4: actionAdmin

 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $Content = new Content('search');
     $Content->unsetAttributes();
     // clear any default values
     if (isset($_GET['Content'])) {
         $Content->attributes = $_GET['Content'];
     }
     $this->render('admin', array('Content' => $Content));
 }
開發者ID:snapfrozen,項目名稱:snapcms,代碼行數:13,代碼來源:ContentController.php

示例5: getAllContent

 /**
  * Retrieves all articles that are published and not password protected
  */
 private function getAllContent()
 {
     $model = new Content('Search');
     $model->unsetAttributes();
     // clear any default values
     unset($_GET['password']);
     unset($_GET['like_count']);
     unset($_GET['comment_count']);
     if (!empty($_GET)) {
         $model->attributes = $_GET;
     }
     // A list of attributes that we want to hide
     $attributes = array('password', 'like_count', 'comment_count');
     $model->status = 1;
     $response = array();
     foreach ($model->search()->getData() as $content) {
         if ($content->isPublished() && ($content->password == "" || Cii::decrypt($content->password) == "")) {
             $response[] = $content->getApiAttributes($attributes);
         }
     }
     return $response;
 }
開發者ID:fandikurnia,項目名稱:CiiMS,代碼行數:25,代碼來源:ContentController.php


注:本文中的Content::unsetAttributes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。