• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Country类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了Country类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: getList

 function getList()
 {
     $this->bd->select($this->tabla, "*", "1=1", array(), "Name, Continent, Code");
     $r = array();
     while ($fila = $this->bd->getRow()) {
         $country = new Country();
         $country->set($fila);
         $r[] = $country;
     }
     return $r;
 }
开发者ID:daw2015,项目名称:plantillas,代码行数:11,代码来源:ManageCountry.php


示例17: testGetCountryList

 function testGetCountryList()
 {
     $result = $this->Country->getCountryList(array('AU', 'US'));
     $expectedTop2 = array('AU' => 'Australia', 'US' => 'United States');
     //	Fetch top 2 items
     $top2 = array();
     $top2[key($result)] = current($result);
     next($result);
     $top2[key($result)] = current($result);
     $this->assertEqual($expectedTop2, $top2);
 }
开发者ID:asavoy,项目名称:country_plugin,代码行数:11,代码来源:country.test.php


示例18: getCountry

 /**
  * Returns the name of the country of the registered user.
  *
  * @return string
  */
 protected function getCountry()
 {
     $countryCode = $this->m_dbObject->getProperty('CountryCode');
     $smartyObj = CampTemplate::singleton();
     $contextObj = $smartyObj->get_template_vars('gimme');
     $country = new Country($countryCode, $contextObj->language->number);
     if (!$country->exists()) {
         return null;
     }
     return $country->getName();
 }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:16,代码来源:MetaUser.php


示例19: getCountiesByGivenCountry

 public function getCountiesByGivenCountry($country_id)
 {
     $countryObj = new Country();
     $country = $countryObj->findById($country_id);
     $data = $country->topTerritories;
     $ret = array();
     foreach ($data as $territory) {
         $ret[$territory->county] = $territory->name;
     }
     return $ret;
 }
开发者ID:rhalff,项目名称:vdragon-api,代码行数:11,代码来源:Territory.php


示例20: delete

 public function delete($id = null)
 {
     if ($this->perm->can_delete == 'y') {
         if ($id) {
             $data = new Country($id);
             $action = 'DELETE';
             save_logs($this->menu_id, $action, $data->id, $action . ' ' . $data->country_name . ' Country');
             $data->delete();
         }
     }
     redirect("admin/" . $this->modules_name);
 }
开发者ID:ultraauchz,项目名称:asean_cultural_mapping,代码行数:12,代码来源:countries.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Coupon类代码示例发布时间:2022-05-23
下一篇:
PHP Countries类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap