0

这可能真的很简单,但我不习惯这种编码方式 - 如何更改此选择菜单:

$control .= '<select name="'. $this->_hash_value($hash, $xml_obj->value) .'" id="'. $this->_hash_value($hash, $xml_obj->value) .'" data-native-menu="false">';
foreach ($nameArr as $folder => $imageArr) {
            foreach ($imageArr as $image) {
                if (substr($folder, 1, strlen($folder)).$image == $xml_obj->value) {
                    $control .= '<option value="'. substr($folder, 1, strlen($folder)).$image .'" selected="selected">'. $image .'</option>';
                } else {
                    $control .= '<option value="'. substr($folder, 1, strlen($folder)).$image .'">'. $image .'</option>';
                }
            }
        }
        $control .= '</select>';

进入单个列表项(具有当前选择项的值),该列表项导致包含用户可以选择的所有项目的基本列表?

4

2 回答 2

1

你应该能够做这样的事情:

$control .= '<ul id="'. $this->_hash_value($hash, $xml_obj->value) .'" data-role="listview" data-theme="g">';
foreach($nameArr as $folder => $imageArr)
{
   foreach ($imageArr as $image) {
      $control .= '<li><a href="'. substr($folder, 1, strlen($folder)).$image .'">'. $image .'</a></li>';
   }
}
$control .= "</ul>";
于 2012-04-11T12:19:01.877 回答
0

清单 1:

$control .= '<ul data-role="listview" data-inset="true">';
        $control .= '<li>';
        $control .= '<a href="'. site_url() .'/mobilegallery/gallery/'.$x[0]->attributes()->indexI.'">Bilder</a>';
        $control .= '</li>';
        $control .= '</ul>';

清单 2,在新页面上:

$html .= '<ul data-role="listview" class="ui-listview" data-inset="true">';
    for($i = 0, $c = $xml->COM->MOVIE->count(); $i < $c; $i++ ){

        $html .= '<li>';
        $html .= '<a>
        <img src="https://[url]/'.rawurlencode($this->_decode_path($xml->COM->MOVIE[$i]->attributes()->dbIcoFilename)).'" id="imgThumb" alt="'.$xml->COM->MOVIE[$i]->attributes()->nameS.'" />
        <h1>'.$xml->COM->MOVIE[$i]->attributes()->nameS.'</h1>
        </a>';
        $html .= ' </li>';

    }
    $html .= '</ul>';
于 2012-04-12T07:29:20.317 回答