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


PHP Country類代碼示例

本文整理匯總了PHP中Country的典型用法代碼示例。如果您正苦於以下問題:PHP Country類的具體用法?PHP Country怎麽用?PHP Country使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Country類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testTranslate

 public function testTranslate()
 {
     $c = new Country();
     $c->setDataSourceDir(SOURCE_DIR);
     $c->setLang('en');
     $this->assertEquals('Sweden', $c->translate('se'));
 }
開發者ID:iio,項目名稱:phpcountry,代碼行數:7,代碼來源:CountryTest.php

示例2: manageArmy

 private function manageArmy(Army $army, Country $country)
 {
     if ($country->isFree()) {
         return;
     }
     $army->increaseSize();
 }
開發者ID:JJacobi13,項目名稱:jcAiBattle,代碼行數:7,代碼來源:TurnManager.php

示例3: createCountry

 public function createCountry($name)
 {
     $tmp = new Country();
     $tmp->name = $name;
     $tmp->save();
     return $tmp;
 }
開發者ID:kaakshay,項目名稱:audience-insight-repository,代碼行數:7,代碼來源:486TestCase.php

示例4: getCountry

 /**
  * For listing the Country
  * @author        Praveen Singh
  * @method        getCountry
  * @param         $module_id,$group_id
  * @return        one row of Module Role table 
  * @since         version 0.0.1
  * @version       0.2.9
  */
 function getCountry($cntId)
 {
     App::import("Model", "Country");
     $model = new Country();
     $datas = $model->find("first", array('conditions' => array('Country.id' => $cntId)));
     return $datas;
 }
開發者ID:praveensingh25000,項目名稱:Bivid,代碼行數:16,代碼來源:CommonHelper.php

示例5: actionModel

 public function actionModel()
 {
     $country = new Country();
     // 		$validate = $country->getValidators();
     $meta = $country->getMetaData();
     var_dump($meta);
 }
開發者ID:liudaiming,項目名稱:Datastructure,代碼行數:7,代碼來源:CountryController.php

示例6: factory

 public static function factory(Storage $storage, $row)
 {
     $country = new Country($storage);
     $country->setCountryID($row["countryid"]);
     $country->setLabel($row["label"]);
     return $country;
 }
開發者ID:jungepiraten,項目名稱:vpanel,代碼行數:7,代碼來源:country.class.php

示例7: CityList

 public function CityList($cuntry_id)
 {
     $h = new Country();
     echo json_encode($h->CityList($cuntry_id));
     // or render View
     return TRUE;
 }
開發者ID:jnaroogheh,項目名稱:darvishi,代碼行數:7,代碼來源:CountryController.php

示例8: get

 public function get()
 {
     $uid = (int) $_REQUEST['uid'];
     if ($uid == 0) {
         $uid = $this->user->id;
     }
     $user = new User();
     $user->get($uid);
     $userData = $user->getRaw();
     //region data
     $region = new Region();
     $regionData = $region->getRaw($userData['region']);
     $userData['region'] = array('id' => $regionData['id'], 'name' => $regionData['name']);
     //counrry data
     $country = new Country();
     $countryData = $country->getRaw($userData['country']);
     $userData['country'] = array('id' => $countryData['id'], 'name' => $countryData['name']);
     // myself
     if ($uid == $this->user->id) {
         $currencyQuantity = $user->getCurrency($userData['currency']);
         $userData['currencyName'] = $userData['currency'];
         $userData['currency'] = $currencyQuantity;
     } else {
         unset($userData['gold']);
         unset($userData['currency']);
     }
     unset($userData['password']);
     return $userData;
 }
開發者ID:AugustoAngeletti,項目名稱:erepublik,代碼行數:29,代碼來源:user.php

示例9: construct

 public static function construct($array)
 {
     $obj = new Country();
     $obj->setName($array['name']);
     $obj->setCode($array['code']);
     $obj->setStates($array['states']);
     return $obj;
 }
開發者ID:ivanknow,項目名稱:curso-angular-php-pl,代碼行數:8,代碼來源:Country.php

示例10: testCountry

 public function testCountry()
 {
     $country = new Country('au');
     $this->assertEquals('AU', $country->getCountryCode());
     $country = new Country('AU');
     $this->assertEquals('AU', $country->getCountryCode());
     $this->assertEquals('Australia', $country->getCountryName());
 }
開發者ID:paulferrett,項目名稱:synergy-wholesale,代碼行數:8,代碼來源:CountryTest.php

示例11: actionAdmin

 public function actionAdmin()
 {
     $model = new Country('search');
     $model->unsetAttributes();
     if (isset($_GET['Country'])) {
         $model->setAttributes($_GET['Country']);
     }
     $this->render('admin', array('model' => $model));
 }
開發者ID:schmunk42,項目名稱:yii-sakila-crud,代碼行數:9,代碼來源:CountryController.php

示例12: actionAdmin

 public function actionAdmin()
 {
     $this->getMaxSorter();
     $this->getMinSorter();
     $this->rememberPage();
     $model = new Country('search');
     $model->setRememberScenario('country_remember');
     $this->render('admin', array_merge(array('model' => $model), $this->params));
 }
開發者ID:barricade86,項目名稱:raui,代碼行數:9,代碼來源:CountryController.php

示例13: get

 function get($Code)
 {
     $parametros = array();
     $parametros['Code'] = $Code;
     $this->bd->select($this->tabla, '*', "Code=:Code", $parametros);
     $fila = $this->bd->getRow();
     $country = new Country();
     $country->set($fila);
     return $country;
 }
開發者ID:ealvarez1990,項目名稱:ludoteca,代碼行數:10,代碼來源:ManageCountry.php

示例14: postCountry

 public function postCountry()
 {
     $posted = Input::get();
     $country = new Country();
     $country->country_name = $posted['country_name'];
     $country->category_id = $posted['category_id'];
     $country->category_name = $posted['category_name'];
     $country->save();
     return Redirect::back()->with('success', 'Country has been created');
 }
開發者ID:bernardowiredu,項目名稱:unlocking-site,代碼行數:10,代碼來源:CountryController.php

示例15: all

 function all()
 {
     $this->is_loggedin();
     $this->title = "Countries";
     $this->message = "BeBuntu Countries";
     $all_countries = new Country();
     pass_var('all_countries', $all_countries->find_all());
     pass_var('title', $this->title);
     pass_var('message', $this->message);
 }
開發者ID:stas,項目名稱:bebuntu,代碼行數:10,代碼來源:countries-controller.php


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