當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Position::exClassify方法代碼示例

本文整理匯總了PHP中Position::exClassify方法的典型用法代碼示例。如果您正苦於以下問題:PHP Position::exClassify方法的具體用法?PHP Position::exClassify怎麽用?PHP Position::exClassify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Position的用法示例。


在下文中一共展示了Position::exClassify方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionIndex

 public function actionIndex()
 {
     $this->poiType = zmf::filterInput($_GET['type']);
     $this->poiOrder = zmf::filterInput($_GET['order']);
     $areaid = zmf::filterInput($_GET['areaid']);
     if (!$this->poiOrder || !in_array($this->poiOrder, array('1', '2'))) {
         $this->poiOrder = '1';
     }
     $where = $order = '';
     if ($areaid) {
         $extra = Area::getAreaInfo($areaid);
         $areaIds = $extra['areaIds'];
         $areaInfo = $extra['areaInfo'];
         if ($areaIds) {
             $where .= " areaid IN({$areaIds}) AND ";
         }
     }
     $_typename = Position::exClassify($this->poiType);
     if ($this->poiType && $_typename && !is_array($_typename)) {
         $where .= " classify='{$this->poiType}' AND ";
     } else {
         $this->poiType = '';
         $_typename = '的景點、酒店、餐廳及購物';
     }
     if ($this->poiOrder == '1') {
         $order = ' ORDER BY score DESC';
     } elseif ($this->poiOrder == '2') {
         $order = ' ORDER BY scorer DESC';
     }
     //獲取景點列表
     $sql = "SELECT id,title_cn,title_en,title_local,address_cn,address_en,address_local,score,scorer,attach,lat,`long`,faceimg,classify FROM {{position}} WHERE {$where} forWedding=1 AND status=" . Posts::STATUS_PASSED . $order;
     Posts::getAll(array('sql' => $sql), $pages, $posts);
     //獲取所有受推薦地區
     $areas = Area::getTops(0);
     //麵包屑
     $breads[] = CHtml::link('目的地', array('position/index'));
     if ($areaInfo) {
         $breads[] = $areaInfo['title'];
     }
     //頁麵SEO
     $this->pageTitle = '目的地 - ' . zmf::config('sitename');
     $this->render('index', array('posts' => $posts, 'pages' => $pages, 'areas' => $areas, 'breads' => $breads, 'areaId' => $areaid));
 }
開發者ID:ph7pal,項目名稱:wedding,代碼行數:43,代碼來源:PositionController.php

示例2: array

<ul class="nav nav-tabs" role="tablist">
  <li <?php 
if (!$this->poiType) {
    echo 'class="active"';
}
?>
><?php 
$attr = array('position/index', 'areaid' => $areaId, 'order' => $this->poiOrder);
$attr = array_filter($attr);
echo CHtml::link('全部', $attr);
?>
</li>
  <?php 
$types = Position::exClassify();
foreach ($types as $type => $title) {
    ?>
  <li <?php 
    if ($this->poiType == $type) {
        echo 'class="active"';
    }
    ?>
><?php 
    $attr = array('position/index', 'areaid' => $areaId, 'type' => $type, 'order' => $this->poiOrder);
    $attr = array_filter($attr);
    echo CHtml::link($title, $attr);
    ?>
</li>
  <?php 
}
?>
  <li class="dropdown pull-right"><a href="#" id="order-poi-type" class="dropdown-toggle" data-toggle="dropdown" ><?php 
開發者ID:ph7pal,項目名稱:wedding,代碼行數:31,代碼來源:_minbar.php


注:本文中的Position::exClassify方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。