當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。