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


PHP Post::unsetAttributes方法代碼示例

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


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

示例1: actionPost

 public function actionPost()
 {
     $model = new Post('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Post'])) {
         $model->attributes = $_GET['Post'];
     }
     $this->render('post', compact('model'));
 }
開發者ID:beckblurry,項目名稱:Yii1-Base-Core-V.Alpha.1,代碼行數:10,代碼來源:ListController.php

示例2: actionIndex

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

示例3: actionCreate

 public function actionCreate()
 {
     $model = new Post();
     if (isset($_POST['Post'])) {
         $model->attributes = $_POST['Post'];
         $model->user_id = Yii::app()->user->id;
         if ($model->save()) {
             $id = $model->id;
             $model->unsetAttributes();
             // reset form
             Yii::app()->user->setFlash('success', "Post Created!");
             $this->redirect(array('post/view', 'id' => $id));
         }
     }
     $this->render('create', array('model' => $model));
 }
開發者ID:sarfraznawaz2005,項目名稱:my-Yii-v1-blog-sample,代碼行數:16,代碼來源:PostController.php

示例4: actionAdmin

 /**
  * Administra todos los modelos.
  */
 public function actionAdmin()
 {
     $model = new Post('search');
     $model->unsetAttributes();
     // borrar los valores por defecto
     if (isset($_GET['Post'])) {
         $model->attributes = $_GET['Post'];
     }
     $this->render('admin', array('model' => $model));
 }
開發者ID:NicoVergara,項目名稱:Blog,代碼行數:13,代碼來源:PostController.php

示例5: getForUser

 public function getForUser($user)
 {
     $posts = new Post('search');
     $posts->unsetAttributes();
     $posts->create_user_id = (int) $user;
     return $posts;
 }
開發者ID:sherifflight,項目名稱:yupe,代碼行數:7,代碼來源:Post.php

示例6: getPosts

 public function getPosts()
 {
     $posts = new Post('search');
     $posts->unsetAttributes();
     $posts->blog_id = $this->id;
     $posts->status = Post::STATUS_PUBLISHED;
     $posts->access_type = Post::ACCESS_PUBLIC;
     return $posts;
 }
開發者ID:sherifflight,項目名稱:yupe,代碼行數:9,代碼來源:Blog.php

示例7: actionAdmin

 public function actionAdmin()
 {
     $lang = $this->getLanguageCode();
     //tạo array để hiện thị trên dropDownList category
     $listCategory_Array = CategoryLanguage::model()->getListCategoryWithLanguage($lang);
     unset($listCategory_Array[1]);
     reset($listCategory_Array);
     $category_id = key($listCategory_Array);
     //lây phan tu dau tien
     if (Yii::app()->request->getParam('id')) {
         //nếu không tồn tại thì lấy phần tử đầu tiên trong category
         $category_id = Yii::app()->request->getParam('id');
     }
     $model = new Post('search');
     $model->unsetAttributes();
     // clear any default values
     $this->render('admin', array('model' => $model->getListPost($lang, $category_id, 1), 'category_id' => $category_id, 'listCategory_Array' => $listCategory_Array, 'lang' => $lang));
 }
開發者ID:huuly188,項目名稱:vietnamrealty,代碼行數:18,代碼來源:PostController.php

示例8: actionIndex

 /**
  * Управление записями.
  *
  * @return void
  */
 public function actionIndex()
 {
     $model = new Post('search');
     $model->unsetAttributes();
     // clear any default values
     $model->comment_status = true;
     if (Yii::app()->getRequest()->getParam('Post')) {
         $model->setAttributes(Yii::app()->getRequest()->getParam('Post'));
     }
     $this->render('index', array('model' => $model));
 }
開發者ID:sherifflight,項目名稱:yupe,代碼行數:16,代碼來源:PostBackendController.php

示例9: actionJobs

 public function actionJobs()
 {
     $model = new Post('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Post'])) {
         $model->attributes = $_GET['Post'];
     }
     //send model object for search
     $this->render('jobs', array('dataProvider' => $model->search(), 'model' => $model));
 }
開發者ID:djeyakumar,項目名稱:aircpit,代碼行數:11,代碼來源:PostController.php

示例10: actionAdmin

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

		$this->render('admin', array(
			'model'=> $model,
		));
	}
開發者ID:nucleartux,項目名稱:YiiCh,代碼行數:13,代碼來源:PostController.php

示例11: actionIndex

 /**
  * Управление записями.
  *
  * @return void
  */
 public function actionIndex()
 {
     $model = new Post('search');
     $model->unsetAttributes();
     // clear any default values
     if (Yii::app()->getRequest()->getParam('Post')) {
         $model->setAttributes(Yii::app()->getRequest()->getParam('Post'));
     }
     $this->render('index', ['model' => $model]);
 }
開發者ID:syrexby,項目名稱:domovoishop.by,代碼行數:15,代碼來源:PostBackendController.php


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