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


PHP Countries::getIso3Flag方法代碼示例

本文整理匯總了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;
 }
開發者ID:hfmprs,項目名稱:JoomLeague,代碼行數:31,代碼來源:helper.php

示例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;
 }
開發者ID:Heart1010,項目名稱:JoomLeague,代碼行數:18,代碼來源:countries.php


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