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


PHP Apartment::getTypesWantArray方法代码示例

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


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

示例1: actionMainform

 public function actionMainform($isFancy = 0)
 {
     $model = new SimpleformModel();
     $model->scenario = 'forrent';
     if (isset($_POST['SimpleformModel'])) {
         $request = Yii::app()->request;
         $isForBuy = $request->getPost('isForBuy', 0);
         $model->attributes = $_POST['SimpleformModel'];
         if ($isForBuy) {
             $model->scenario = 'forbuy';
         }
         if ($model->validate()) {
             /* if($_POST['SimpleformModel']['type'] != Apartment::TYPE_RENTING){
                                $model->time_inVal = NULL;
                                $model->time_outVal = NULL;
                                $model->date_start = NULL;
                                $model->date_end = NULL;
                            }elseif ($model->time_in || $model->time_out) {
             				$model->time_inVal = $this->getI18nTimeIn($model->time_in);
             				$model->time_outVal = $this->getI18nTimeOut($model->time_out);
             			}*/
             //$types = Apartment::getI18nTypesArray();
             //$model->type = $types[$model->type];
             $notifier = new Notifier();
             $notifier->raiseEvent('onNewBooking', $model);
             Yii::app()->user->setFlash('success', tt('Operation successfully complete. Your order will be reviewed by administrator.'));
         }
     }
     $user = null;
     if (!Yii::app()->user->isGuest) {
         $user = User::model()->findByPk(Yii::app()->user->getId());
     }
     $type = Apartment::getTypesWantArray();
     if ($isFancy) {
         $this->excludeJs();
         $this->renderPartial('simpleform', array('model' => $model, 'type' => $type, 'user' => $user, 'isFancy' => true), false, true);
     } else {
         $this->render('simpleform', array('model' => $model, 'type' => $type, 'user' => $user, 'isFancy' => false));
     }
 }
开发者ID:alexjkitty,项目名称:estate,代码行数:40,代码来源:MainController.php


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