当前位置: 首页>>代码示例>>PHP>>正文


PHP Comment::unsetAttributes方法代码示例

本文整理汇总了PHP中Comment::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::unsetAttributes方法的具体用法?PHP Comment::unsetAttributes怎么用?PHP Comment::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comment的用法示例。


在下文中一共展示了Comment::unsetAttributes方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionAdmin

 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Comment('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Comment'])) {
         $model->attributes = $_GET['Comment'];
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:stan5621,项目名称:jp_edu_online,代码行数:13,代码来源:CommentController.php

示例2: actionView

 public function actionView($id)
 {
     $model = $this->loadModel($id);
     if (isset($_POST['Comment'])) {
         $modelComment = new Comment();
         $modelComment->attributes = $_POST['Comment'];
         $modelComment->post_id = $id;
         if ($modelComment->save()) {
             $modelComment->unsetAttributes();
             // reset form
             Yii::app()->user->setFlash('success', "Comment added!");
         }
     }
     $this->render('view', array('model' => $model));
 }
开发者ID:sarfraznawaz2005,项目名称:my-Yii-v1-blog-sample,代码行数:15,代码来源:PostController.php

示例3: actionIndex

	/**
	 * Display all site comments
	 */
	public function actionIndex()
	{
	
		$model = new Comment('search');
		$model->unsetAttributes();  // clear any default values

		if(!empty($_GET['Comment']))
			$model->attributes = $_GET['Comment'];

		$dataProvider = $model->search();
		$dataProvider->pagination->pageSize = Yii::app()->settings->get('core', 'productsPerPageAdmin');

		$this->render('index', array(
			'model'=>$model,
			'dataProvider'=>$dataProvider
		));
	}
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:20,代码来源:CommentsController.php

示例4: actionIndex

    public function actionIndex() {


        $model = new Comment('search');
        $model->unsetAttributes();

        if(!empty($_GET['Comment']))
            $model->attributes = $_GET['Comment'];

        $criteria = new CDbCriteria;
        $criteria->condition = 'id_parent is null';
        $dataProvider = $model->search($criteria);
        $dataProvider->pagination->pageSize = 25;

        $this->render('index', array(
            'model'=>$model,
            'dataProvider'=>$dataProvider
        ));
    }
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:19,代码来源:DefaultController.php

示例5: actionManage

 /**
  * Manages all models.
  */
 public function actionManage()
 {
     $model = new Comment('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['status'])) {
         $model->status = $_GET['status'];
     }
     $this->render('manage', array('model' => $model));
 }
开发者ID:awecode,项目名称:awecms,代码行数:13,代码来源:CommentController.php

示例6: actionAdmin

 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     if (isset($_GET['pageSize'])) {
         Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
         unset($_GET['pageSize']);
         // would interfere with pager and repetitive page size change
     }
     $model = new Comment('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Comment'])) {
         $model->attributes = $_GET['Comment'];
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:ASDAFF,项目名称:RosYama.2,代码行数:18,代码来源:CommentController.php

示例7: actionTrash

 public function actionTrash($id = NULL)
 {
     $model = new Comment('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Comment'])) {
         $model->attributes = $_GET['Comment'];
     }
     if (isset($id)) {
         $model = $this->loadModel($id);
         $model->status = 1;
         $ids = array();
         $result = Comment::model()->getAllParent($id, $ids);
         if ($model->save(true, array('status'))) {
             $transaction = Yii::app()->db->beginTransaction();
             try {
                 if ($result && Comment::model()->updateAllNode($model->status, $ids)) {
                     $transaction->commit();
                 }
             } catch (Exception $ex) {
                 $transaction->rollback();
             }
             Yii::app()->user->setFlash('success', Yii::t('comment', 'Comment was re-activate.'));
         } else {
             Yii::app()->user->setFlash('error', Yii::t('comment', 'Comment cannot re-activate. Please try it later.'));
         }
         $this->redirect(array('/' . backend . '/comment/trash'));
     }
     $this->render(strtolower($this->action->Id), array('model' => $model));
 }
开发者ID:huuly188,项目名称:vietnamrealty,代码行数:30,代码来源:CommentController.php

示例8: actionAdmin

 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $travelerId = null;
     if (isset($_GET['travelerId'])) {
         $travelerId = $_GET['travelerId'];
     } else {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $model = new Comment('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Comment'])) {
         $model->attributes = $_GET['Comment'];
     }
     $this->render('admin', array('model' => $model, 'travelerId' => $travelerId));
 }
开发者ID:Romandre90,项目名称:vectortraveler,代码行数:19,代码来源:CommentController.php

示例9: actionIndex

 /**
  * Manages all models.
  */
 public function actionIndex()
 {
     $model = new Comment('search');
     $model->unsetAttributes();
     // clear any default values
     $model->setAttributes(Yii::app()->getRequest()->getParam('Comment', array()));
     $this->render('index', array('model' => $model));
 }
开发者ID:sherifflight,项目名称:yupe,代码行数:11,代码来源:CommentBackendController.php


注:本文中的Comment::unsetAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。