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


PHP News::unsetAttributes方法代碼示例

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


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

示例1: actionIndex

 public function actionIndex()
 {
     $model = new News();
     $model->unsetAttributes();
     $model->attributes = $this->aRequest('News');
     $this->render('index', array('model' => $model));
 }
開發者ID:sunshy360,項目名稱:cubingchina,代碼行數:7,代碼來源:NewsController.php

示例2: actionNews

 public function actionNews($slug = null)
 {
     if ($slug === null) {
         $model = new News('search');
         $model->unsetAttributes();
         $model->isList = true;
         $model->category_id = Yii::app()->request->getParam('category_id');
         $this->render('news', array('model' => $model));
     } else {
         $model = $this->loadNews($slug);
         $model->saveCounters(array('countViews' => 1));
         //  to memcache mb
         $comment = new NewsComment();
         if (isset($_POST['ajax']) && $_POST['ajax'] === 'newsComment-form') {
             echo CActiveForm::validate($comment);
             Yii::app()->end();
         }
         if (isset($_POST['NewsComment'])) {
             $comment->attributes = $_POST['NewsComment'];
             $comment->news_id = $model->id;
             $comment->user_id = Yii::app()->user->id;
             if ($comment->validate() && $comment->preSave()) {
                 $comment->unsetAttributes();
                 Yii::app()->user->setFlash('comment_success', true);
                 $this->redirect(array('/site/news', 'slug' => $model->slug, '#' => 'comments'));
             }
         }
         $criteria = new CDbCriteria();
         $criteria->compare('news_id', $model->id);
         $criteria->order = '`id` ASC';
         $comments = NewsComment::model()->findAll($criteria);
         $this->render('news_inner', array('model' => $model, 'comment' => $comment, 'comments' => $comments));
     }
 }
開發者ID:postfx,項目名稱:fermion,代碼行數:34,代碼來源:SiteController.php

示例3: actionIndex

 public function actionIndex()
 {
     $model = new News('search');
     $model->unsetAttributes();
     if (isset($_GET['News'])) {
         $model->attributes = $_GET['News'];
     }
     $this->render('index', array('model' => $model));
 }
開發者ID:postfx,項目名稱:fermion,代碼行數:9,代碼來源:NewsController.php

示例4: actionList

	public function actionList()
	{
		$model = new News('search');
		$model->unsetAttributes();
		if(isset($_GET['News']))
			$model->attributes=$_GET['News'];
		Yii::app()->session['myurl'] = $this->createUrl('list');
		$this->render('list',array('model'=>$model));
	}
開發者ID:noikiy,項目名稱:letstravel,代碼行數:9,代碼來源:NewsController.php

示例5: actionManage

 public function actionManage()
 {
     $model = new News('search');
     $model->unsetAttributes();
     if (isset($_GET['News'])) {
         $model->setAttributes($_GET['News']);
     }
     $this->render('manage', array('model' => $model));
 }
開發者ID:awecode,項目名稱:awecms,代碼行數:9,代碼來源:NewsController.php

示例6: actionIndex

 public function actionIndex()
 {
     $model = new News('search');
     $model->unsetAttributes();
     if (isset($_GET['News'])) {
         $model->setAttributes($_GET['News']);
     }
     $dataProvider = $model->search();
     $this->render('//news/index', array('dataProvider' => $dataProvider, 'model' => $model));
 }
開發者ID:mmorpg2015,項目名稱:ghtweb5,代碼行數:10,代碼來源:NewsController.php

示例7: actionAdmin

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

示例8: actionIndex

	/**
	 * Lists all models.
	 */
	public function actionIndex()
	{
        $model=new News('search');
        $model->unsetAttributes();  // clear any default values
        if(isset($_GET['News']))
            $model->attributes=$_GET['News'];

        $this->render('index',array(
        'model'=>$model,
        ));
	}
開發者ID:Vladimirtishenko,項目名稱:garmata.tv,代碼行數:14,代碼來源:NewsController.php

示例9: actionIndex

 public function actionIndex()
 {
     $this->pageName = Yii::t('NewsModule.default', 'MODULE_NAME');
     $this->breadcrumbs = array($this->pageName);
     $model = new News('search');
     $model->unsetAttributes();
     if (!empty($_GET['News'])) {
         $model->attributes = $_GET['News'];
     }
     $this->render('index', array('model' => $model));
 }
開發者ID:buildshop,項目名稱:bs-common,代碼行數:11,代碼來源:DefaultController.php

示例10: actionIndex

 public function actionIndex()
 {
     $this->layout = '//layouts/admin';
     $this->pageTitle = 'Новости';
     $this->breadcrumbs = array('Новости');
     $model = new News('search');
     $model->unsetAttributes();
     if (isset($_GET['News'])) {
         $model->attributes = $_GET['News'];
     }
     $this->render('index', array('model' => $model));
 }
開發者ID:42point,項目名稱:Vinum,代碼行數:12,代碼來源:DefaultController.php

示例11: actionIndex

 public function actionIndex()
 {
     $model = new News('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['News'])) {
         $model->attributes = $_GET['News'];
         $model->parent_id = $model->category_news_id;
         $model->category_news_id = null;
         dump($model->attributes, false);
     }
     $this->render('index', array('model' => $model));
 }
開發者ID:phiphi1992,項目名稱:alongaydep,代碼行數:13,代碼來源:NewsController.php

示例12: actionIndex

 public function actionIndex($id)
 {
     $catelog = CategoriesNews::model()->findByPk($id);
     if ($catelog == null) {
         throw new CHttpException('404', 'Không tìm thấy trang.');
     }
     $model = new News('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['News'])) {
         $model->attributes = $_GET['News'];
     }
     $this->render('index', array('model' => $model, 'catalog' => $catelog));
 }
開發者ID:phiphi1992,項目名稱:fpthue,代碼行數:14,代碼來源:NewsController.php

示例13: actionIndex

 /**
  * Manages all models.
  */
 public function actionIndex($idTree = null, $organization = null)
 {
     if ($idTree != null && $organization != null) {
         $allIfns = false;
         if (!Tree::model()->exists('id=:id AND module=:module and organization=:organization', array(':id' => $idTree, ':module' => 'news', ':organization' => $organization))) {
             throw new CHttpException(404, 'Страница не найдена.');
         }
     } else {
         $allIfns = true;
     }
     $model = new News('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['News'])) {
         $model->attributes = $_GET['News'];
     }
     $this->render('index', array('model' => $model, 'idTree' => $allIfns ? CHtml::listData(Organization::model()->findAll('code<>:code', array(':code' => '8600')), 'code', 'code') : $idTree, 'organization' => $organization, 'allIfns' => $allIfns));
 }
開發者ID:alexeevich,項目名稱:portal,代碼行數:21,代碼來源:NewsController.php

示例14: actionAdmin

 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     if ($this->menu_use[3]) {
         $model = new News('searchInSide');
         $news_type_list = array();
         $criteria = new CDbCriteria();
         $criteria->condition = 'status=:status AND news_type_id=5';
         $criteria->params = array(':status' => 1);
         $criteria->order = 'sort_order';
         $news_type = NewsGroup::model()->findAll($criteria);
         foreach ($news_type as $type) {
             $news_type_list[$type->news_group_id] = $type->name_th;
         }
         $model->unsetAttributes();
         // clear any default values
         if (isset($_GET['News'])) {
             $model->attributes = $_GET['News'];
         }
         $this->render('admin', array('model' => $model, 'news_type_list' => $news_type_list));
     } else {
         $this->redirect(array('site/index'));
     }
 }
開發者ID:ultr4h4ck,項目名稱:project_gspa,代碼行數:26,代碼來源:NewsInSideController.php

示例15: actionAdmin

	/**
	 * Manages all models.
	 */
	public function actionAdmin()
	{
        if(Yii::app()->user->checkAccess('admin')){
            $model=new News('search');
            $model->unsetAttributes();  // clear any default values
            if(isset($_GET['News']))
                $model->attributes=$_GET['News'];

            $this->render('admin',array(
                'model'=>$model,
            ));
        } else {
            $this->redirect('/admin/user/login');
        }
	}
開發者ID:schiz,項目名稱:teff,代碼行數:18,代碼來源:NewsController.php


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