本文整理汇总了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));
}
示例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);
}
}
}
}
}
示例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'));
}
}
示例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));
}
示例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'));
示例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) {