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


PHP Filter::getGenreId方法代码示例

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


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

示例1: run

 public function run()
 {
     //Filter::initialization();
     //error_log(print_r(Yii::app()->basePath,true));
     $data = array();
     $event = Events::$even;
     if (Filter::getSortByDate()) {
         usort($event, "Events::sortByDate");
     } elseif (Filter::getSortByPopularity()) {
         usort($event, "Events::sortByPopularity");
     }
     //error_log(print_r($this->controller->getViewFile('poster'),true));
     $data['ajaxContent'] = $this->controller->renderPartial('poster', array('parameters' => $event), true);
     $data['main_menu'] = $this->controller->renderPartial('main_menu', array(), true);
     $location = new Location();
     $style = new Style();
     $data['country'] = $location->selectContry();
     if (!Filter::getCountryId()) {
         Filter::setCountryId(current(array_keys($data['country'])));
     }
     $data['city'] = $location->selectCity(Filter::getCountryId());
     if (!Filter::getCityId()) {
         Filter::setCityId(0);
     }
     //Filter::setCityId(current(array_keys($data['city'])));
     $data['style'] = $style->selectStyle();
     if (!Filter::getStyleId()) {
         Filter::setStyleId(current(array_keys($data['style'])));
     }
     /*Filter::getStyleId()*/
     $data['genre'] = $style->selectGenre(Filter::getStyleId());
     if (!Filter::getGenreId()) {
         Filter::setGenreId(current(array_keys($data['genre'])));
     }
     $data['model'] = new FilterForm();
     $this->controller->render('index', $data);
     //$this->controller->render('translationUser', array('row'=>0));
 }
开发者ID:vasia-ostapchuk,项目名称:source,代码行数:38,代码来源:IndexAction.php

示例2: array

$options = null;
?>
        <?php 
echo $form->error($model, 'style') . "\n";
?>
    </div>
    <div class="filter-label">
        <?php 
echo $form->labelEx($model, 'genre') . "\n";
?>
        <?php 
//echo $form->dropDownList($model,'genre', $genre). "\n";
?>
        <?php 
if (Filter::getGenreId()) {
    $options[Filter::getGenreId()] = array('selected' => true);
} else {
    $options[0] = array('selected' => true);
}
echo CHtml::dropDownList('genre', '', $genre, array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('filter/genre'), 'success' => 'function(jdata){' . 'var data = $.parseJSON(jdata);' . 'jQuery("#style").html(data.data);' . '}'), 'options' => $options));
$options = null;
?>
        <?php 
echo $form->error($model, 'genre') . "\n";
?>
    </div>

    <div class="price-scroll">
        <h1>Квиткові ціни:</h1> 
        
        <input type="text" class="min" name="price_min" value="<?php 
开发者ID:vasia-ostapchuk,项目名称:source,代码行数:31,代码来源:index.php

示例3: actionGenre

 public function actionGenre()
 {
     // error_log('genre_id ' . Yii::app()->request->getPost('genre'));
     Filter::setGenreId(Yii::app()->request->getPost('genre'));
     $tagList = '';
     if (Filter::getGenreId() != 0) {
         $data = Style::model()->selectStyleAllParameters();
         $tagList .= CHtml::tag('option', array('value' => $data[Filter::getGenreId()]['style_id'], 'selected' => true), CHtml::encode($data[Filter::getGenreId()]['name']), true) . "\n";
     } else {
         $data = Style::model()->selectStyle();
         //Filter::setStyleId(0);
         foreach ($data as $key => $value) {
             if (Filter::getStyleId() == $key) {
                 $tagList .= CHtml::tag('option', array('value' => $key, 'selected' => true), CHtml::encode($value), true) . "\n";
             } else {
                 $tagList .= CHtml::tag('option', array('value' => $key), CHtml::encode($value), true) . "\n";
             }
         }
         $this->responceAjax($tagList);
         Yii::app()->end();
         /*$nameStyle=$data[0];
           echo CHtml::tag('option', array('value'=>0), CHtml::encode($data[0]), true) . "\n";*/
     }
     //error_log(print_r($data,true));
     $name = '';
     //echo CHtml::tag('option', array('value'=>0, 'selected'=>true), CHtml::encode('All genre'), true) . "\n";
     $nameStyle = $data[Filter::getGenreId()]['name'];
     // error_log($nameStyle);
     Filter::setStyleId($data[Filter::getGenreId()]['style_id']);
     //error_log(Filter::getStyleId());
     foreach ($data as $key => $value) {
         if ($name == $value['name'] || $nameStyle == $value['name']) {
             continue;
         }
         $tagList .= CHtml::tag('option', array('value' => $value['style_id']), CHtml::encode($value['name']), true) . "\n";
         $name = $value['name'];
     }
     $this->responceAjax($tagList);
 }
开发者ID:vasia-ostapchuk,项目名称:source,代码行数:39,代码来源:FilterController.php


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