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


PHP SearchForm::apTypes方法代码示例

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


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

示例1: tt

    <?php 
if ($this->searchShowLabel) {
    ?>
	<div class="bt1 <?php 
    echo $textClass;
    ?>
"><?php 
    echo tt('Search in section', 'common');
    ?>
:</div>
    <?php 
}
?>
	<li>
		<?php 
$data = SearchForm::apTypes();
echo CHtml::dropDownList('apType', isset($this->apType) ? CHtml::encode($this->apType) : '', $data['propertyType'], array('class' => $fieldClass . ' searchField'));
?>
	</li>

开发者ID:barricade86,项目名称:raui,代码行数:19,代码来源:_bt_search_field_ap_type.php

示例2: generateMap


//.........这里部分代码省略.........
                 $map['contact_form']['url'][$keyLang] = Yii::app()->createAbsoluteUrl('contactform/main/index');
                 $map['contact_form']['lastmod'][$keyLang] = isset($indexPageInfo) && isset($indexPageInfo->date_updated) ? date($this->dateFormat, strtotime($indexPageInfo->date_updated)) : $defaultLastMod;
                 $map['booking_form']['title'][$keyLang] = tt('booking_form');
                 $map['booking_form']['url'][$keyLang] = Yii::app()->createAbsoluteUrl('booking/main/mainform');
                 $map['booking_form']['lastmod'][$keyLang] = isset($indexPageInfo) && isset($indexPageInfo->date_updated) ? date($this->dateFormat, strtotime($indexPageInfo->date_updated)) : $defaultLastMod;
             }
         }
         $this->app->setLanguage($this->defaultLang);
     } else {
         $map['contact_form']['title'] = tt('contact_form');
         $map['contact_form']['url'] = Yii::app()->createAbsoluteUrl('contactform/main/index');
         $map['booking_form']['title'] = tt('booking_form');
         $map['booking_form']['url'] = Yii::app()->createAbsoluteUrl('booking/main/mainform');
     }
     ####################################### search #######################################
     if ($isXml) {
         if ($this->activeLangs && is_array($this->activeLangs)) {
             foreach ($this->activeLangs as $keyLang => $valLang) {
                 $this->app->setLanguage($valLang);
                 $map['quick_search']['title'][$keyLang] = tt('quick_search');
                 $map['quick_search']['url'][$keyLang] = Yii::app()->createAbsoluteUrl('quicksearch/main/mainsearch');
                 $sql = 'SELECT MAX(date_updated) as date_updated FROM {{apartment}}';
                 $maxUpdatedApartment = Yii::app()->db->createCommand($sql)->queryRow();
                 $maxUpdatedApartment = isset($maxUpdatedApartment['date_updated']) ? date($this->dateFormat, strtotime($maxUpdatedApartment['date_updated'])) : $defaultLastMod;
                 $map['quick_search']['lastmod'][$keyLang] = $maxUpdatedApartment;
             }
         }
         $this->app->setLanguage($this->defaultLang);
     } else {
         $map['quick_search']['title'] = tt('quick_search');
         $map['quick_search']['url'] = Yii::app()->createAbsoluteUrl('quicksearch/main/mainsearch');
     }
     ####################################### search subtypes #######################################
     $types = SearchForm::apTypes();
     if (is_array($types) && isset($types['propertyType'])) {
         $i = 0;
         foreach ($types['propertyType'] as $key => $value) {
             if ($key > 0) {
                 if ($isXml) {
                     $apartmentsByType = null;
                     $result = null;
                     $titles = array();
                     if ($this->activeLangs && is_array($this->activeLangs)) {
                         foreach ($this->activeLangs as $keyLang => $valLang) {
                             $titles[] = 'title_' . $valLang;
                         }
                     }
                     if (count($titles)) {
                         $titles = implode(',', $titles);
                         $sql = 'SELECT id, ' . $titles . ', date_updated FROM {{apartment}} WHERE price_type = ' . $key . ' AND active = ' . Apartment::STATUS_ACTIVE . ' AND owner_active = ' . Apartment::STATUS_ACTIVE . ' ORDER BY date_updated DESC';
                         $result = Yii::app()->db->createCommand($sql)->queryAll();
                     }
                     if ($result) {
                         foreach ($result as $item) {
                             $apartmentsByType[$item['id']] = $item;
                         }
                     }
                     $k = 0;
                     if (is_array($apartmentsByType) && count($apartmentsByType) > 0) {
                         $urls = array();
                         if ($this->activeLangs && is_array($this->activeLangs)) {
                             foreach ($this->activeLangs as $keyLang => $valLang) {
                                 $urls[] = 'url_' . $valLang;
                             }
                         }
                         if (issetModule('seo') && count($urls)) {
开发者ID:barricade86,项目名称:raui,代码行数:67,代码来源:MainController.php

示例3: renderFilter

 public function renderFilter(&$criteria)
 {
     // start set filter
     $this->filterPriceType = Yii::app()->request->getParam('filterPriceType');
     if ($this->filterPriceType) {
         $criteria->addCondition('price_type = :filterPriceType');
         $criteria->params[':filterPriceType'] = $this->filterPriceType;
     }
     $this->filterObjType = Yii::app()->request->getParam('filterObjType');
     if ($this->filterObjType) {
         $criteria->addCondition('obj_type_id = :filterObjType');
         $criteria->params[':filterObjType'] = $this->filterObjType;
     }
     $this->filterByLat = Yii::app()->request->getParam('filterByLat');
     if ($this->filterByLat) {
         $criteria->addCondition('lat = :filterByLat');
         $criteria->params[':filterByLat'] = $this->filterByLat;
     }
     $this->filterByLng = Yii::app()->request->getParam('filterByLng');
     if ($this->filterByLng) {
         $criteria->addCondition('lng = :filterByLng');
         $criteria->params[':filterByLng'] = $this->filterByLng;
     }
     // end set filter
     // echo filter form
     $data = SearchForm::apTypes();
     echo '<div class="block-filter-viewallonmap">';
     echo '<form method="GET" action="" id="form-filter-viewallonmap">';
     echo CHtml::dropDownList('filterPriceType', isset($this->filterPriceType) ? CHtml::encode($this->filterPriceType) : '', $data['propertyType']);
     echo CHtml::dropDownList('filterObjType', isset($this->filterObjType) ? CHtml::encode($this->filterObjType) : 0, CMap::mergeArray(array(0 => Yii::t('common', 'Please select')), Apartment::getObjTypesArray()));
     echo CHtml::button(tc('Filter'), array('onclick' => '$("#form-filter-viewallonmap").submit();', 'id' => 'click-filter-viewallonmap', 'class' => 'inline button-blue'));
     echo '</form>';
     echo '</div>';
 }
开发者ID:alexjkitty,项目名称:estate,代码行数:34,代码来源:ViewallonmapWidget.php

示例4: renderFilter

 public function renderFilter(&$criteria)
 {
     // start set filter
     $this->filterPriceType = Yii::app()->request->getParam('filterPriceType');
     if ($this->filterPriceType) {
         $criteria->addCondition('price_type = :filterPriceType');
         $criteria->params[':filterPriceType'] = $this->filterPriceType;
     }
     $this->filterObjType = Yii::app()->request->getParam('filterObjType');
     if ($this->filterObjType) {
         $criteria->addCondition('obj_type_id = :filterObjType');
         $criteria->params[':filterObjType'] = $this->filterObjType;
     }
     // Комнаты
     $this->roomsCount = $_GET['rooms'];
     if ($this->roomsCount) {
         $criteria->addCondition('num_of_rooms = :roomsCount');
         $criteria->params[':roomsCount'] = $this->roomsCount;
     }
     // !Комнаты
     // end set filter
     // echo filter form
     $data = SearchForm::apTypes();
     echo '<div class="block-filter-viewallonmap">';
     echo '<form method="GET" action="" id="form-filter-viewallonmap">';
     echo CHtml::dropDownList('filterPriceType', isset($this->filterPriceType) ? CHtml::encode($this->filterPriceType) : '', $data['propertyType']);
     echo CHtml::dropDownList('filterObjType', isset($this->filterObjType) ? CHtml::encode($this->filterObjType) : 0, CMap::mergeArray(array(0 => Yii::t('common', 'Please select')), Apartment::getObjTypesArray()));
     // Комнаты
     $roomItems = array('0' => Yii::t('common', 'Number of rooms'), '1' => 1, '2' => 2, '3' => 3, '4' => Yii::t('common', '4 and more'));
     echo CHtml::dropDownList('rooms', isset($this->roomsCount) ? CHtml::encode($this->roomsCount) : 0, $roomItems, array('class' => $fieldClass . ' searchField'));
     // !Комнаты
     echo CHtml::button(tc('Filter'), array('onclick' => '$("#form-filter-viewallonmap").submit();', 'id' => 'click-filter-viewallonmap', 'class' => 'inline button-blue'));
     echo '</form>';
     echo '</div>';
 }
开发者ID:barricade86,项目名称:raui,代码行数:35,代码来源:ViewallonmapWidget.php


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