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