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