当前位置: 首页>>代码示例>>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;未经允许,请勿转载。