本文整理汇总了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;
}