Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Search 搜索时城市的Osclass下拉选择,而不是类别选择_Search_Osclass - Fatal编程技术网

Search 搜索时城市的Osclass下拉选择,而不是类别选择

Search 搜索时城市的Osclass下拉选择,而不是类别选择,search,osclass,Search,Osclass,剧本是奥斯卡 这是原始代码 ?php if ( osc_count_categories() ) { ?> <div class="cell selector"> <?php osc_categories_select('sCategory', null, __('Select a category', 'bender')) ; ?> </div>

剧本是奥斯卡

这是原始代码

?php  if ( osc_count_categories() ) { ?>
            <div class="cell selector">
                <?php osc_categories_select('sCategory', null, __('Select a category', 'bender')) ; ?>
            </div>
            <div class="cell reset-padding">
        <?php  } else { ?>
            <div class="cell">
        <?php  } ?>
            <button class="ui-button ui-button-big js-submit"><?php _e("Search", 'bender');?></button>
        </div>
?php if(osc\u count\u categories()){>
如何编辑此代码以使用户选择要搜索的城市而不是类别

谢谢大家。

我找到了解决方案=) 多亏了

只需添加此代码

<?php $aCities = City::newInstance()->listAll(); ?>
<?php if(count($aCities) > 0 ) { ?>
<select name="sCity" id="sCity">
<option value=""><?php _e('Select a city...')?></option>
    <?php foreach($aCities as $city) { ?>
    <option value="<?php echo $city['s_name'] ; ?>"><?php echo $city['s_name'] ; ?></option>
    <?php } ?>
</select>
<?php } ?>