當前位置: 首頁>>代碼示例>>PHP>>正文


PHP vmJsApi::JcountryStateList方法代碼示例

本文整理匯總了PHP中vmJsApi::JcountryStateList方法的典型用法代碼示例。如果您正苦於以下問題:PHP vmJsApi::JcountryStateList方法的具體用法?PHP vmJsApi::JcountryStateList怎麽用?PHP vmJsApi::JcountryStateList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vmJsApi的用法示例。


在下文中一共展示了vmJsApi::JcountryStateList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderStateList

    /**
     * Render a simple state list
     *
     * @author jseros, Patrick Kohl
     *
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $_prefix = '', $multiple = FALSE, $required = 0)
    {
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId, $_prefix);
        if ($multiple) {
            $attrs = 'multiple="multiple" size="12" name="' . $_prefix . 'virtuemart_state_id[]" ';
            //$class = 'class="inputbox multiple"';
        } else {
            /*$app = JFactory::getApplication();
            		if($app->isSite()) {
            			$class = 'class="chzn-select"';
            		} else {
            			$class = 'class="inputbox multiple"';
            		}*/
            $attrs = 'name="' . $_prefix . 'virtuemart_state_id" ';
        }
        if ($required != 0) {
            $attrs .= ' required';
        }
        $attrs .= ' class="vm-chzn-select"';
        $listHTML = '<select  id="' . $_prefix . 'virtuemart_state_id" ' . $attrs . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
開發者ID:Roma48,項目名稱:abazherka_old,代碼行數:38,代碼來源:shopfunctions.php

示例2: renderStateList

    /**
     * Render a simple state list
     *
     * @author Patrick Kohl
     * NOte Patrick Kohl added unique ID, javascript is broken if you have 2 lists
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $prefix = '', $multiple = FALSE, $required = 0)
    {
        $id = $prefix . 'virtuemart_state_id';
        // prevent using same ID, in all case this break the sate render if id is same.
        static $keys = array();
        if (isset($keys[$id])) {
            return;
        }
        $keys[$id] = true;
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId, $prefix);
        if ($multiple) {
            $attrs = 'multiple="multiple" size="12" name="' . $id . '[]" ';
            //$class = 'class="inputbox multiple"';
        } else {
            $attrs = 'size="1"  name="' . $id . '" ';
        }
        if ($required != 0) {
            $attrs .= ' required';
        }
        $class = 'class="inputbox multiple"';
        $listHTML = '<select ' . $class . ' id="' . $id . '" ' . $attrs . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
開發者ID:denis1001,項目名稱:Virtuemart-2-Joomla-3-Bootstrap,代碼行數:39,代碼來源:shopfunctions.php

示例3: renderStateList

    /**
     * Render a simple state list
     *
     * @author Valerie Isaksen, Max Milbers
     *
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $_prefix = '', $multiple = FALSE, $required = 0, $attribs = array())
    {
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId, $_prefix);
        $attrs['class'] = 'vm-chzn-select';
        if ($multiple) {
            $attrs['name'] = $_prefix . 'virtuemart_state_id[]';
            $attrs['multiple'] = 'multiple';
        } else {
            $attrs['name'] = $_prefix . 'virtuemart_state_id';
        }
        /*if ($required != 0) {
        			$attrs['class'] .= ' required ';
        		}*/
        if (is_array($attribs)) {
            $attrs = array_merge($attrs, $attribs);
        }
        $attrString = JArrayHelper::toString($attrs);
        $listHTML = '<select  id="' . $_prefix . 'virtuemart_state_id" ' . $attrString . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
開發者ID:sergy444,項目名稱:joomla,代碼行數:36,代碼來源:shopfunctions.php

示例4: renderStateList

    /**
     * Render a simple state list
     *
     * @author jseros, Patrick Kohl
     *
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $_prefix = '', $multiple = FALSE, $required = 0)
    {
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId);
        if ($multiple) {
            $attrs = 'multiple="multiple" size="12" name="' . $_prefix . 'virtuemart_state_id[]" ';
        } else {
            $attrs = 'size="1"  name="' . $_prefix . 'virtuemart_state_id" ';
        }
        if ($required != 0) {
            $attrs .= ' required';
        }
        $listHTML = '<select class="inputbox multiple" id="virtuemart_state_id" ' . $attrs . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
開發者ID:romuland,項目名稱:khparts,代碼行數:30,代碼來源:shopfunctions.php


注:本文中的vmJsApi::JcountryStateList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。