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


PHP Pages::getPageById方法代码示例

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


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

示例1: run

 public function run()
 {
     $model = new ProGlobalEnquiry('create');
     $model->country_id = ActiveRecord::getDefaultAreaCode();
     if (isset(Yii::app()->user->id)) {
         $model->name = Yii::app()->user->title . ' ' . Yii::app()->user->first_name . ' ' . Yii::app()->user->last_name;
         $model->email = Yii::app()->user->email;
         if (Yii::app()->user->role_id != ROLE_REGISTER_MEMBER) {
             $model->email = Yii::app()->user->email_not_login;
         }
         $model->phone = Yii::app()->user->phone;
         $model->country_id = Yii::app()->user->country;
     }
     if (isset(Yii::app()->user->id)) {
         $cmsFormater = new CmsFormatter();
         $mUser = Users::model()->findByPk(Yii::app()->user->id);
         $model->name = $cmsFormater->formatFullNameRegisteredUsers($mUser);
         $model->email = $mUser->email;
         $model->nric = $mUser->nric_passportno_roc;
         $model->phone = $mUser->phone;
         if (Yii::app()->user->role_id == ROLE_LANDLORD || Yii::app()->user->role_id == ROLE_TENANT) {
             $model->phone = $mUser->contact_no;
             $model->email = $mUser->email_not_login;
         }
         if (Yii::app()->user->role_id == ROLE_AGENT) {
             $model->email = $mUser->email_not_login;
         }
     }
     //        $model->type_selling= 'Tenancy';
     $box = Pages::getPageById(PAGE_ENGAGE_US_BOX);
     $this->render("global_enquiry", array('model' => $model, 'box' => $box));
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:32,代码来源:GlobalEnquiry.php

示例2: addPage

 public function addPage($parentPageId, $address, $status = 'active')
 {
     //читаем инфу по родительской стр из бд
     $pageModel = new Pages($this->dbObject);
     $parPage = $pageModel->getPageById($parentPageId);
     if ($parPage['status'] == 'active') {
         //есть ли у этой родительской стр дочерние с таким же именем
         $children = $pageModel->getChildren($parentPageId);
         foreach ($children as $child) {
             if ($child['address'] == $address) {
                 //такая страница уже существует
             } else {
                 $level = $parPage['level'] + 1;
                 //создать стр, внести запись в таблицу бд
                 $newId = $pageModel->setNewPage($address, $parentPageId, $level, $status);
                 //прочитать все группы пользователей в массив
                 $usersModel = new Users($this->dbObject);
                 $groups = $usersModel->getAllUserGroups();
                 //перебрать массив, созлать записи в router_contents
                 foreach ($groups as $group) {
                     $content = '';
                     //&&&&&&&&&&&&&%%%%%%%%%%%%%%%%%###############
                     $pageModel->setContent($newId, $group['gid'], $content);
                 }
             }
         }
     }
 }
开发者ID:kittiwake,项目名称:ownfrw,代码行数:28,代码来源:RouterController.php

示例3: run

 public function run()
 {
     $box = Pages::getPageById(PAGE_PROPERTY_BOX);
     $model = new ProEnquiryProperty();
     $mListing = Listing::model()->findByPk($this->property_id);
     //        echo $mListing->property_name_or_address;die;
     Listing::ReplaceContentCmsPage($box, $mListing);
     $model->country_id = ActiveRecord::getDefaultAreaCode();
     if (isset(Yii::app()->user->id)) {
         $model->name = Yii::app()->user->title . ' ' . Yii::app()->user->first_name . ' ' . Yii::app()->user->last_name;
         $model->email = Yii::app()->user->email;
         if (Yii::app()->user->role_id != ROLE_REGISTER_MEMBER) {
             $model->email = Yii::app()->user->email_not_login;
         }
         $model->phone = Yii::app()->user->phone;
         $model->country_id = Yii::app()->user->country;
     }
     $this->dir = Yii::getPathOfAlias('application.components.views') . '/_agent_detail.php';
     $model->description = trim(strip_tags($box->content));
     if ($this->position == "bottom") {
         $this->render("enquiry_bottom", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'bottom'));
     } else {
         $this->render("enquiry_right", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'right'));
     }
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:25,代码来源:EnquiryProperty.php

示例4: run

 public function run()
 {
     $model = new ProGlobalEnquiry();
     $box = Pages::getPageById(PAGE_ENGAGE_US_BOX);
     if (isset($_POST['ProGlobalEnquiry'])) {
         echo "aaaaaaaaa";
         $model->attributes = $_POST['ProGlobalEnquiry'];
     }
     $this->render('index', array('model' => $model, 'box' => $box));
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:10,代码来源:Enquiry.php

示例5: actionAddPropertyItem

         }
     } else {
         $this->redirect(Yii::app()->createAbsoluteUrl('/'));
     }
 }
 public function actionAddPropertyItem()
 {
     if (isset($_GET['id'])) {
         $model = new ProEnquiryProperty();
         if (isset($_POST['ProEnquiryProperty'])) {
             $model->attributes = $_POST['ProEnquiryProperty'];
             if ($model->validate()) {
                 $model->property_id = $_GET['id'];
                 if ($model->save()) {
                     $thankYouEnquiry = Pages::getPageById(PAGE_THANK_ENQUIRY_PROPERTY);
                     Yii::app()->user->setFlash('success', $thankYouEnquiry->content);
                     //insert Subscriber
                     if (!empty($_POST['ProEnquiryProperty']['get_update'])) {
                         Subscriber::saveSubscriberPublic($model->email, 2, $model->name);
                     }
                     /*
                          * -----------------
                          * dtoan : send mail
                          * -----------------
                          */
                     SendEmail::sendEmailEnquiryForAgent($model);
                     SendEmail::sendEmailEnquiryForSender($model);
                     Yii::app()->session['propertyId'] = $model->property_id;
                     $this->redirect(Yii::app()->createAbsoluteUrl('page/index', array('slug' => $thankYouEnquiry->slug)));
                     //                        $this->redirect(Yii::app()->createAbsoluteUrl('site/thankyou'));
开发者ID:jasonhai,项目名称:onehome,代码行数:30,代码来源:EnquiryController.php

示例6: actionMyshortlist

 public function actionMyshortlist()
 {
     try {
         $this->pageTitle = 'My Shortlist - ' . Yii::app()->params['title'];
         $this->layout = 'application.views.layouts.layout_user';
         //Kvan
         $shortList = ProUserShortList::getShortListByUser(Yii::app()->user->id);
         $arrShortListing = array();
         if (!empty($shortList)) {
             foreach ($shortList as $listing) {
                 $arrShortListing[] = $listing->listing_id;
             }
         }
         $listing = Listing::getListingByArrId($arrShortListing);
         $this->render('normal_user/myshortlist', array('listing' => $listing));
     } catch (Exception $exc) {
         echo $exc->getMessage();
     }
 }
 //Kvan
 public function actionSendEnquiryShortList()
 {
     $this->pageTitle = 'Enquiry Multiple Listing - ' . Yii::app()->params['title'];
     $this->layout = 'application.views.layouts.layout_user';
     if (isset($_POST['chkList'])) {
         $arrEnquiry = $_POST['chkList'];
         $listing = Listing::getListingByArrId($arrEnquiry);
         $model = new ProEnquiryProperty();
         $model->name = Yii::app()->user->first_name . ' ' . Yii::app()->user->last_name;
         $model->email = Yii::app()->user->email;
         $model->phone = Yii::app()->user->phone;
         $model->country_id = Yii::app()->user->country;
         if (isset($_POST['ProEnquiryProperty'])) {
             $model->attributes = $_POST['ProEnquiryProperty'];
             $model->get_update = 1;
             if ($model->validate()) {
                 foreach ($arrEnquiry as $enquiry) {
开发者ID:jasonhai,项目名称:onehome,代码行数:37,代码来源:Member_profileController.php


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