当前位置: 首页>>代码示例>>PHP>>正文


PHP Country::getAllCountries方法代码示例

本文整理汇总了PHP中Country::getAllCountries方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::getAllCountries方法的具体用法?PHP Country::getAllCountries怎么用?PHP Country::getAllCountries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Country的用法示例。


在下文中一共展示了Country::getAllCountries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetCountryByHost

 function testGetCountryByHost()
 {
     $hu = new Country("HU");
     $this->assertEquals(array("hu" => "Magyarország"), $hu->getNativeName());
     $this->assertEquals(array("hu" => "Magyarország"), $hu->getNativeShortName());
     $this->assertEquals(array("hu" => "Magyarország"), $hu->getNativeOfficialName());
     $this->assertEquals("Hungary (Magyarország)", $hu->getDisplayName("en"));
     $this->assertEquals("Europe/Budapest", $hu->getMainTimezone());
     $this->assertEquals(true, $hu->isEUMember());
     $hu = new Country("PT");
     $this->assertEquals(array("pt" => "Portugal"), $hu->getNativeName());
     $this->assertEquals(array("pt" => "Portugal"), $hu->getNativeShortName());
     $this->assertEquals(array("pt" => "República Portuguesa"), $hu->getNativeOfficialName());
     $this->assertEquals("Portugal", $hu->getDisplayName("en"));
     $this->assertEquals("Atlantic/Azores", $hu->getMainTimezone());
     $this->assertEquals(true, $hu->isEUMember());
     $countries = $hu->getAllCountries();
     foreach ($countries as $country) {
         $this->assertNotNull($country->getShortNameByLocale('hu'));
         $this->assertNotNull($country->getShortNameByLocale('en'));
         $this->assertNotNull($country->getNativeShortName());
     }
     foreach ($this->countries as $countryCode) {
         $this->assertTrue(array_key_exists($countryCode, $countries), $countryCode . ' not found');
     }
 }
开发者ID:janoszen,项目名称:i18n,代码行数:26,代码来源:CountryTest.php

示例2: array

echo $form->textFieldRow($model->event, 'city', array('class' => 'span12', 'maxlength' => 20));
?>


		<?php 
echo $form->textFieldRow($model->event, 'province', array('class' => 'span12', 'maxlength' => 20));
?>


		<?php 
echo $form->textFieldRow($model->event, 'postal_code', array('class' => 'span12', 'maxlength' => 7));
?>


		<?php 
echo $form->dropDownListRow($model->event, 'country_id', CHtml::listData(Country::getAllCountries(), 'country_id', 'country_name'), array('prompt' => Yii::t('model', 'country_id_empty')));
?>


		<div class="control-group">
			<?php 
echo $form->labelEx($model->event, 'phone', array('class' => 'control-label'));
?>

			<div class="controls">

				<?php 
$this->widget('CMaskedTextField', array('model' => $model->event, 'attribute' => 'phone', 'mask' => '(999) 999-9999'));
?>

			</div>
开发者ID:aakbar24,项目名称:CollegeCorner_Ver_2.0,代码行数:31,代码来源:_form.php

示例3: array

echo $form->textFieldRow($model->workshop, 'city', array('class' => 'span12', 'maxlength' => 20));
?>


	<?php 
echo $form->textFieldRow($model->workshop, 'province', array('class' => 'span12', 'maxlength' => 20));
?>


	<?php 
echo $form->textFieldRow($model->workshop, 'postal_code', array('class' => 'span12', 'maxlength' => 7));
?>


	<?php 
echo $form->dropDownListRow($model->workshop, 'country_id', CHtml::listData(Country::getAllCountries(), 'country_id', 'country_name'), array('prompt' => Yii::t('model', 'country_id_empty'), 'class' => 'span12'));
?>


	<div class="control-group">
			<?php 
echo $form->labelEx($model->workshop, 'phone', array('class' => 'control-label'));
?>

			<div class="controls">

				<?php 
$this->widget('CMaskedTextField', array('model' => $model->workshop, 'attribute' => 'phone', 'mask' => '(999) 999-9999', 'htmlOptions' => array('class' => 'span12')));
?>

			</div>
开发者ID:aakbar24,项目名称:CollegeCorner_Ver_2.0,代码行数:31,代码来源:_form.php


注:本文中的Country::getAllCountries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。