本文整理汇总了PHP中BFCHelper::getMerchantCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::getMerchantCategories方法的具体用法?PHP BFCHelper::getMerchantCategories怎么用?PHP BFCHelper::getMerchantCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFCHelper
的用法示例。
在下文中一共展示了BFCHelper::getMerchantCategories方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
$document = JFactory::getDocument();
$language = $document->getLanguage();
$merchantCategories = BFCHelper::getMerchantCategories();
$options = array();
if ($merchantCategories) {
foreach ($merchantCategories as $merchantCategory) {
$currOpt = JHtml::_('select.option', $merchantCategory->MerchantCategoryId, BFCHelper::getLanguage($merchantCategory->Name, $language));
$currOpt->checked = null;
$options[] = $currOpt;
}
}
$options = array_merge(parent::getOptions(), $options);
return $options;
}
示例2: get_site_url
<?php
$base_url = get_site_url();
$language = $GLOBALS['bfi_lang'];
$categoriesoptions = array();
$merchantCategories = BFCHelper::getMerchantCategories();
foreach ($merchantCategories as $category) {
$categoriesoptions[$category->MerchantCategoryId] = $category->Name;
}
?>
<form method="POST" action="<?php
echo $base_url;
?>
/bfi/settings/list-merchants-form-process">
Title:<br>
<input type="text" name="title" value=""><br>
Route:<br>
<input type="text" name="route" value=""><br>
Merchant Categories:<br>
<?php
foreach ($categoriesoptions as $key => $val) {
?>
<input type="checkbox" name="categories[<?php
echo $key;
?>
]" value="<?php
echo $val;
?>
"> <?php
echo $val;
?>