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