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


PHP Pages::model方法代码示例

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


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

示例1: actionFinduser

 public function actionFinduser()
 {
     $result = array();
     $result1 = array();
     $data = $_POST['searchword'];
     $user = UserProfile::model()->findAll('first_name LIKE :name', array(':name' => "%{$data}%"));
     $page = Pages::model()->findAll('company_name LIKE :name', array(':name' => "%{$data}%"));
     $result = array_merge($user, $page);
     shuffle($result);
     //       foreach($result as $r):
     //           print_r($r['attributes']);
     //       endforeach;
     //       return;
     foreach ($result as $u) {
         $html = '<div class="display_box" align="left" style="position:relative; z-index:3;">';
         if (isset($u['first_name'])) {
             $id = $u['user_id'];
             $img = $u['image'];
             $html .= '<a  href = "' . Yii::app()->baseUrl . '/index.php/user/viewprofile/userId/' . $id . '"><img src="' . Yii::app()->baseUrl . '/uploads/user_' . $id . '/' . $img . '"style=float:left; margin-right:6px; width=40 height = 40 />&nbsp&nbsp<span style = "font-size:15px">' . $u['first_name'] . '&nbsp;' . $u['last_name'] . '<br/>';
             $html .= '&nbsp;<span style="font-size:9px; color:#999999">' . "USER" . '</span></div></a><br/>';
             echo $html;
         } elseif (isset($u['company_name'])) {
             $id = $u['user_id'];
             $img = $u['image'];
             $html .= '<a href = "' . Yii::app()->baseUrl . '/index.php/businesspage/viewpage/' . $u->id . '"><img src="' . Yii::app()->baseUrl . '/uploads/business_page_' . $id . '/' . $img . '"style="float:left; margin-right:6px" width="40px"; height ="40px"; />&nbsp<span style = "font-size:15px">' . $u['company_name'] . '&nbsp;</span>(' . $u['domain'] . ')<br/>';
             $html .= '<span style="font-size:9px; color:#999999">' . "PAGE" . '</span></div><br/>';
             echo $html;
         }
     }
 }
开发者ID:nomannoor,项目名称:social-property,代码行数:30,代码来源:UserController.php

示例2: actionSitemap

 public function actionSitemap()
 {
     $pages = Pages::model()->findAll();
     $news = News::model()->findAll();
     header('Content-Type: application/xml');
     $this->renderPartial('../site/sitemap', array('pages' => $pages, 'news' => $news));
 }
开发者ID:lajayuhniyarsyah,项目名称:SupraCompProfile,代码行数:7,代码来源:SiteController.php

示例3: actionIndex

 public function actionIndex($id)
 {
     $model = Pages::model()->findByPk($id);
     $model->url = mb_strtolower($model->url);
     $model->url = str_replace("http://", "", $model->url);
     header('Location: http://' . $model->url);
 }
开发者ID:Diakonrus,项目名称:fastweb-yii,代码行数:7,代码来源:UrllinkController.php

示例4: actionCreate

 public function actionCreate()
 {
     //echo realpath(Yii::app()->baseUrl);            return;
     $model = new Pages();
     $this->layout = 'layout_user';
     // uncomment the following code to enable ajax-based validation
     /*
     if(isset($_POST['ajax']) && $_POST['ajax']==='pages-create-form')
     {
         echo CActiveForm::validate($model);
         Yii::app()->end();
     }
     */
     if (isset($_POST['Pages'])) {
         $model->attributes = $_POST['Pages'];
         if ($model->validate()) {
             $page = Pages::model()->find('id=:p_id', array(':p_id' => Yii::app()->session['pageId']));
             $page->company_name = $_POST['Pages']['company_name'];
             $page->type = $_POST['Pages']['type'];
             $page->address = $_POST['Pages']['address'];
             $page->description = $_POST['Pages']['description'];
             $page->save();
             // form inputs are valid, do something here
             return;
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:nomannoor,项目名称:social-property,代码行数:28,代码来源:PagesController.php

示例5: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $page = Pages::model()->findByPk(1);
     $comments = Posts::model()->templates()->roots()->findAll();
     $childrens = Posts::getCountChildrens($comments);
     $this->render('index', ['page' => $page, 'comments' => $comments, 'childrens' => $childrens]);
 }
开发者ID:R0dgerV,项目名称:test-post-comment,代码行数:11,代码来源:SiteController.php

示例6: actionIndex

 public function actionIndex($id)
 {
     $model = Pages::model()->findByPk($id);
     if (!$model || $model->status == 0) {
         throw new CHttpException(404, 'The page can not be found.');
     }
     //Титл и SEO
     $this->setSEO($model->url, mb_convert_case($model->title, MB_CASE_UPPER, "UTF-8"));
     $this->layout = '//layouts/' . $model->main_template;
     $modelCatalog = null;
     $modelNews = null;
     //Если главная - добавляю товары помеченые как на главную и новости
     if ($model->main_page == 1) {
         $modelCatalog = CatalogElements::model()->findAll('`status` = 1 AND `primary` = 1');
         $modelNews = NewsElements::gatPrimaryNews();
     }
     //Проверка прав доступа
     if ($model->access_lvl > 0) {
         if (Yii::app()->user->isGuest) {
             $this->redirect('/login');
         }
     }
     //Проверяем есть ли фотогалерея, если есть - меняем содержимое страницы
     $model->content = $this->addPhotogalery($model->content);
     //Проверяем есть ли форма, если есть - меняем содержимое страницы
     $model->content = $this->addForm($model->content);
     //Получаем вкладки если есть;
     $modelTabs = PagesTabs::model()->getTabsContent($id);
     $this->render('index', array('model' => $model, 'modelTabs' => $modelTabs, 'modelCatalog' => $modelCatalog, 'modelNews' => $modelNews));
 }
开发者ID:Diakonrus,项目名称:fastweb-yii,代码行数:30,代码来源:PagesController.php

示例7: run

 public function run()
 {
     $page_id = $this->page_id;
     $controller = Yii::app()->getController();
     $model = new ModuleList3();
     if (!is_null($page_id) && Pages::model()->existsPage($page_id)) {
         $this->create_item($page_id, $model);
         $this->update_order($page_id);
         $mpage_id = ModulesInPages::model()->getLink((int) $page_id, $this->module_id);
         if ($mpage_id == 5) {
             $mpage_id = 4;
         }
         if ($mpage_id == 54) {
             $mpage_id = 4;
         }
         if ($mpage_id == 56) {
             $mpage_id = 4;
         }
         if ($mpage_id == 58) {
             $mpage_id = 4;
         }
         $params_list = ModuleList3Params::model()->getList($mpage_id);
         $this->render('module_list3', array('model' => $model, 'params_list' => $params_list, 'page_id' => $page_id));
     } else {
         $controller->redirect(Yii::app()->request->scriptUrl);
     }
 }
开发者ID:arduanov,项目名称:eco,代码行数:27,代码来源:Module_list3.php

示例8: setSEO

 public function setSEO($url_patch, $page_title = null, $modelSEO = null)
 {
     $url_patch = trim($url_patch);
     $this->pageTitle = (!empty($page_title) ? $page_title . ' - ' : '') . $this->pageTitle;
     $url_array = explode("/", parse_url($url_patch, PHP_URL_PATH));
     foreach ($url_array as $url) {
         $model = Pages::model()->find('url LIKE "' . $url . '"');
         if ($model) {
             if (!empty($model->meta_title)) {
                 $this->pageTitle = $model->meta_title;
                 $this->pageMetaTitle = $model->meta_title;
             }
             if (!empty($model->meta_keywords)) {
                 $this->pageKeywords = $model->meta_keywords;
             }
             if (!empty($model->meta_description)) {
                 $this->pageDescription = $model->meta_description;
             }
         }
     }
     if (!empty($modelSEO)) {
         if (isset($modelSEO->meta_title) && !empty($modelSEO->meta_title)) {
             $this->pageTitle = $modelSEO->meta_title;
             $this->pageMetaTitle = $modelSEO->meta_title;
         }
         if (isset($modelSEO->meta_keywords) && !empty($modelSEO->meta_keywords)) {
             $this->pageKeywords = $modelSEO->meta_keywords;
         }
         if (isset($modelSEO->meta_description) && !empty($modelSEO->meta_description)) {
             $this->pageDescription = $modelSEO->meta_description;
         }
     }
     return true;
 }
开发者ID:Diakonrus,项目名称:fastweb-yii,代码行数:34,代码来源:Controller.php

示例9: getPages

 protected function getPages()
 {
     if (!$this->_pages) {
         $c = new CDbCriteria();
         $this->_pages = Pages::model()->findAll($c);
     }
     return $this->_pages;
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:8,代码来源:CmsUrlRule.php

示例10: run

 public function run()
 {
     $criteria = new CDbCriteria();
     $criteria->select = 'name, title';
     $criteria->order = 'name';
     $model = Pages::model()->findAll($criteria);
     $this->render('widgetPages', array('model' => $model));
 }
开发者ID:noiary,项目名称:Aion-Core-v4.7.5,代码行数:8,代码来源:WidgetPages.php

示例11: loadModel

 public function loadModel($id)
 {
     $model = Pages::model()->not_deleted()->findByPk($id);
     if (!$model) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:8,代码来源:PagesController.php

示例12: getAllAction

 public function getAllAction()
 {
     $criteria = new CDbCriteria();
     $result = Pages::model()->findAll($criteria);
     if ($result) {
         return CHtml::listData($result, 'slug', 'slug');
     }
     return array();
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:9,代码来源:PageController.php

示例13: getNewsInfoForNavs

 public static function getNewsInfoForNavs()
 {
     $news = Pages::model()->findAll('type=:type', array(':type' => 'news'));
     $newsInfos = array();
     foreach ($news as $new) {
         $newsInfo = array('title' => $new->title, 'url' => Yii::app()->createUrl('admin/news', array('id' => $new->id)));
         array_push($newsInfos, $newsInfo);
     }
     return $newsInfos;
 }
开发者ID:bgshechka,项目名称:pos-shop,代码行数:10,代码来源:Pages.php

示例14: actionLocal

 public function actionLocal()
 {
     //$this->checkAccess('Admin');
     $page = Pages::model()->find('alias=:alias', array('alias' => 'local'));
     $this->pageTitle = $page->lang->title ? $page->lang->title : Yii::t('app', 'Локальный сервер');
     $this->pageDescription = $page->lang->meta_description;
     $this->pageKeywords = $page->lang->meta_keywords;
     $this->layout = 'home';
     $this->render('local', array('page' => $page));
 }
开发者ID:Wiedzal,项目名称:araucano,代码行数:10,代码来源:PricingController1.php

示例15: run

 public function run($page_name = 'index')
 {
     $dependency = new CDbCacheDependency("SELECT MAX(UNIX_TIMESTAMP(updated_at)) FROM {{pages}} WHERE page = :page AND status = :status AND lang = :lang");
     $dependency->params = array('page' => $page_name, 'status' => ActiveRecord::STATUS_ON, 'lang' => app()->getLanguage());
     $model = Pages::model()->cache(3600 * 24, $dependency)->opened()->find('page = :page AND lang = :lang', array('page' => $page_name, 'lang' => app()->getLanguage()));
     if ($model === NULL) {
         throw new CHttpException(404, Yii::t('main', 'Страница не найдена.'));
     }
     app()->getController()->render('//page', array('model' => $model));
 }
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:10,代码来源:DetailAction.php


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