本文整理匯總了PHP中Countries::getIso3Flag方法的典型用法代碼示例。如果您正苦於以下問題:PHP Countries::getIso3Flag方法的具體用法?PHP Countries::getIso3Flag怎麽用?PHP Countries::getIso3Flag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Countries
的用法示例。
在下文中一共展示了Countries::getIso3Flag方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getpix
public function getpix($team)
{
$pt = $this->params->get('picture_type');
if ($this->params->get('show_picture') == 0) {
return false;
}
$appendimage = ' align="middle" ';
$countrycode = $team->country;
if ($pt == "country" && strlen($countrycode) == 3) {
$pic['src'] = Countries::getIso3Flag($countrycode);
$pic['alt'] = Countries::getCountryName($countrycode);
} else {
$defaultlogos = $this->getDefaultLogos();
$matchpart_pic = !empty($team->{$pt}) && file_exists(JPATH_ROOT . '/' . $team->{$pt}) ? $team->{$pt} : $defaultlogos[$pt];
if (file_exists(JPATH_ROOT . '/' . $matchpart_pic)) {
$size = getimagesize(JPATH_ROOT . '/' . $matchpart_pic);
$pic_width = $size[0];
$pic_height = $size[1];
$whichparam = $pic_width > $pic_height ? ' width' : ' height';
if ($this->params->get('xsize') > 0) {
$appendimage .= $whichparam . '="' . $this->params->get('xsize') . '"';
} elseif ($this->params->get('ysize') > 0) {
$appendimage .= $whichparam . '="' . $this->params->get('ysize') . '"';
}
}
$pic['src'] = trim($matchpart_pic) != "" && file_exists(JPATH_ROOT . '/' . trim($matchpart_pic)) ? JUri::root(true) . '/' . $matchpart_pic : JUri::root(true) . '/' . $defaultlogos[$pt];
$pic['alt'] = $this->jl_utf8_convert($team->name, 'iso-8859-1', 'utf-8');
}
$pic['append'] = $appendimage;
return $pic;
}
示例2: getCountryFlag
/**
* example: echo Countries::getCountryFlag($country);
*
* @param string: an iso3 country code, e.g AUT
* @param string: additional html attributes for the img tag
* @return string: html code for the flag image
*/
public static function getCountryFlag($countrycode, $attributes = '')
{
self::includeLanguageFile();
$src = Countries::getIso3Flag($countrycode);
if (!$src) {
return '';
}
$html = '<img src="' . $src . '" alt="' . Countries::getCountryName($countrycode) . '" ';
$html .= 'title="' . Countries::getCountryName($countrycode) . '" ' . $attributes . ' />';
return $html;
}