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


PHP Country::all方法代码示例

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


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

示例1: personalinfo

 public function personalinfo()
 {
     $driver = User::first(array('id = ?' => $this->user->id));
     if ($driver->cab_driver == 1) {
         $view = $this->getActionView();
         $states = State::all();
         $countries = Country::all();
         $driver = CabDriver::first(array('user_id = ?' => $this->user->id));
         $view->set('states', $states)->set('countries', $countries)->set('driver', $driver);
         if (RequestMethods::post('full_name')) {
             $driver->full_name = RequestMethods::post('full_name');
             $driver->contact = RequestMethods::post('contact');
             $driver->country = RequestMethods::post('country');
             $driver->state = RequestMethods::post('state');
             $driver->pincode = RequestMethods::post('pin');
             $driver->address = RequestMethods::post('address');
             $driver->pinfo_flag = '1';
             if ($driver->validate()) {
                 $driver->save();
                 header("Location: /driver/vehicleinfo");
             } else {
                 $view->set('error', "validation  not good");
             }
         }
     } else {
         header('/');
     }
 }
开发者ID:shreyanshgoel,项目名称:tours,代码行数:28,代码来源:driver.php

示例2: Tours

 public function Tours()
 {
     $SliderImages = SliderImages::all();
     $tours = Tours::all();
     $country = Country::all();
     return View::make('tours.tours')->with('slider', $SliderImages)->with('tours', $tours)->with('country', $country);
 }
开发者ID:hilmysyarif,项目名称:LightTravelLaravel,代码行数:7,代码来源:HomeController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //get all the countries
     $countries = Country::all();
     // load the view and pass the countries
     return View::make('countries.index')->with('countries', $countries);
 }
开发者ID:juniarsofyan,项目名称:laravel-with-ajax,代码行数:12,代码来源:CountryController.php

示例4: Countries

 public function Countries()
 {
     $h = new Country();
     echo json_encode($h->all($page = '', $perpage = ''));
     // or render View
     return TRUE;
 }
开发者ID:jnaroogheh,项目名称:darvishi,代码行数:7,代码来源:CountryController.php

示例5: getIndex

 /**
  * Display a listing of settings
  *
  * @return Response
  */
 public function getIndex()
 {
     $user = Auth::user()->id;
     // Grab user settings
     $setting = User::find($user)->setting;
     $countries = Country::all();
     return View::make('settings.index', compact('setting', 'countries'));
 }
开发者ID:mladjom,项目名称:smartinvoice,代码行数:13,代码来源:SettingsController.php

示例6: index

 public function index()
 {
     // init
     $data = array('menu' => $this->_menu, 'title' => 'Negara', 'description' => '', 'breadcrumb' => array('Negara' => route('admin.country')));
     // Set countries
     $data['countries'] = Country::all();
     return View::make('admin.pages.country.index')->with($data);
 }
开发者ID:whiterun,项目名称:bagikasih-v2,代码行数:8,代码来源:AdminCountryController.php

示例7: getCountries

 public function getCountries($view)
 {
     $countries = Country::all();
     if (count($countries) > 0) {
         $options = array_combine($countries->lists('code'), $countries->lists('name'));
     } else {
         $options = array(null, 'No Countries');
     }
     $view->with('countries', $options);
 }
开发者ID:zhoumingchun,项目名称:beehive-web,代码行数:10,代码来源:ViewHelper.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // Se valida si llega u filtro para consultar, de lo contrario se retorna la lista completa.
     if (Input::get(Config::get('constants.QUERY'))) {
         $countriesList = Country::where('countryId', 'LIKE', '%' . Input::get(Config::get('constants.QUERY')) . '%')->orWhere('name', 'LIKE', '%' . Input::get(Config::get('constants.QUERY')) . '%')->get();
     } else {
         $countriesList = Country::all();
     }
     return $this->respondWithCollection($countriesList, new CountryTransformer());
 }
开发者ID:jhoansebastianlara,项目名称:esclinicadigital,代码行数:15,代码来源:CountryController.php

示例9: profile

 public static function profile()
 {
     if (current_user_can('profile')) {
         $user_id = get_current_user_id();
         $usermeta = \UserMeta::where('user_id', $user_id)->first();
         $cities = self::idandname(\City::all(), "id", "name");
         $provinces = self::idandname(\Province::all(), "id", "name");
         $countries = self::idandname(\Country::all(), "id", "name");
         View::make("site/user/profile", compact('cities', 'provinces', 'countries', 'usermeta'));
         die;
     }
     wp_redirect("/login");
     exit;
 }
开发者ID:hasangilak,项目名称:wp-semi-laravel,代码行数:14,代码来源:UserController.php

示例10: postSelectPackage

 public function postSelectPackage()
 {
     //verify the user input and create account
     $validator = Validator::make(Input::all(), array('Package' => 'required'));
     if ($validator->fails()) {
         return Redirect::route('advanced_squeeb-get')->withInput()->with('global', 'Please select a package.');
     } else {
         $package = Input::get('Package');
         View::share('package', $package);
         //check for the world package
         if ($package == 'pkg1') {
             $countries = Country::all();
             View::share('countries', $countries);
             $obj = new BaseController();
             $countryid = 0;
             $countryname = $obj->getCountryName();
             if ($countryname != 'NONE') {
                 $locationcountry = Country::where('name', '=', $countryname);
                 if ($locationcountry->count()) {
                     $countryid = $locationcountry->first()->id;
                     $colleges = Institution::where('country_id', '=', $countryid)->get();
                     View::share('colleges', $colleges);
                 }
             }
             View::share('countryid', $countryid);
             return View::make('guest.advancedselectcollege');
         } else {
             if ($package == 'pkg2') {
                 $countries = Country::all();
                 View::share('countries', $countries);
                 $obj = new BaseController();
                 $countryid = 0;
                 $countryname = $obj->getCountryName();
                 if ($countryname != 'NONE') {
                     $locationcountry = Country::where('name', '=', $countryname);
                     if ($locationcountry->count()) {
                         $countryid = $locationcountry->first()->id;
                     }
                 }
                 View::share('countryid', $countryid);
                 return View::make('guest.advancedpostcountry')->with('msg', 'Country Squeeb Package');
             }
         }
         if ($package == 'pkg3') {
             return View::make('guest.advancedpost')->with('msg', 'World Squeeb Package');
         }
     }
 }
开发者ID:franqq,项目名称:squeeber,代码行数:48,代码来源:AdvancedPostController.php

示例11: postSaveDocument

 public function postSaveDocument($id_document)
 {
     $return = array('status' => 0, 'message' => 'System Error');
     if (Request::ajax()) {
         $id_document = (int) $id_document;
         $Document = Document::findOrFail($id_document);
         $Document->saveProducts(Input::get('products'));
         $Document->user_id = Auth::user()->id;
         if ($Document->save()) {
             $Countries = Country::all();
             $Products = $Document->AlreadyOffered();
             $ViewData = array('DocumentProducts' => $Products, 'Countries' => $Countries);
             $return = array('status' => 1, 'message' => 'Success!', 'ProductsBlock' => $ViewData);
         }
     }
     return Response::json($return);
 }
开发者ID:salvakexx,项目名称:doc_example,代码行数:17,代码来源:laravel42example.php

示例12: myaccount

 public function myaccount()
 {
     $view = $this->getActionView();
     $states = State::all();
     $countries = Country::all();
     $view->set('states', $states)->set('countries', $countries);
     if (RequestMethods::post('update')) {
         $user = User::first(array('id = ?' => $this->user->id));
         $user->full_name = RequestMethods::post('full_name');
         $user->country = RequestMethods::post('country');
         $user->state = RequestMethods::post('state');
         $user->pincode = RequestMethods::post('pin');
         $user->address = RequestMethods::post('address');
         if ($user->validate) {
             $user->save();
         } else {
             echo "validation  not good";
         }
     }
 }
开发者ID:shreyanshgoel,项目名称:tours,代码行数:20,代码来源:users.php

示例13: countryList

 /**
  * Display a list countries
  * POST /countrylist
  *
  * @return Response
  */
 public function countryList()
 {
     $arr = array();
     $countries = Country::all();
     $arr = array();
     if (count($countries) > 0) {
         $arr['Success'] = true;
         $arr['Status'] = 'OK';
         $arr['StatusCode'] = 200;
         $arr['Result'] = array();
         $i = 0;
         foreach ($countries as $country) {
             $arr['Result'][$i]['id'] = $country->country_id;
             $arr['Result'][$i]['name'] = ucfirst($country->name);
             $i++;
         }
     } else {
         $arr['Success'] = false;
         $arr['Status'] = 'Country not found';
         $arr['StatusCode'] = 404;
     }
     return Response::json($arr);
 }
开发者ID:glennpeterm,项目名称:MyStoryWeb,代码行数:29,代码来源:CountriesController.php

示例14: editar

 public function editar($id)
 {
     if (!$id) {
         $this->session->set_flashdata('msg', '<div class="notice">El alumno solicitado no existe.</div>');
         redirect('alumnos');
     } elseif ($_POST) {
         $this->load->helper('date');
         $this->load->library('Utils');
         $insert = $_POST;
         $insert['fecha_nacimiento'] = $this->utils->fecha_formato('%Y-%m-%d', $insert['fecha_nacimiento']);
         $insert['fecha_inscripcion'] = $this->utils->fecha_formato('%Y-%m-%d', $insert['fecha_inscripcion']);
         $alumno = Student::find($id);
         $alumno->update_attributes(elements(array('city_id', 'nombre', 'apellido', 'fecha_nacimiento', 'sexo', 'tipo_documento', 'nro_documento', 'domicilio', 'tenencia', 'nacionalidad', 'grupo_sanguineo', 'telefono', 'celular', 'obs_medicas', 'observaciones', 'colegio_procedencia', 'fecha_inscripcion'), $insert));
         if ($alumno->is_valid()) {
             if ($alumno->save()) {
                 $this->session->set_flashdata('msg', '<div class="success">El alumno se guardó correctamente.</div>');
                 redirect($this->agent->referrer());
             } else {
                 $this->session->set_flashdata('msg', '<div class="error">Hubo un error al guardar los datos.</div>');
                 redirect($this->agent->referrer());
             }
         } else {
             $data['errors'] = $alumno->errors;
         }
     } else {
         $data['a'] = Student::find($id);
     }
     $data['paises'] = Country::all();
     $data['provincias'] = State::all();
     $data['ciudades'] = City::all();
     $data['titulo'] = "Editar alumno";
     $data['action'] = "alumnos/editar/" . $id;
     $this->template->write_view('content', 'alumnos/agregar', $data);
     $this->template->render();
 }
开发者ID:ricardocasares,项目名称:Cobros,代码行数:35,代码来源:alumnos.php

示例15: basename

<?php

use Intervention\Image\ImageManagerStatic as Image;
include __DIR__ . '/vendor/autoload.php';
$filesystem = new Illuminate\Filesystem\Filesystem();
$flags = $filesystem->files('input');
$countries = Country::all();
foreach ($flags as $flag) {
    $country = basename($flag, '.png');
    if (isset($countries[$country])) {
        $path = strtolower('output/' . $countries[$country] . '.png');
        $img = Image::make($flag);
        $img->resize(16, null, function ($constraint) {
            $constraint->aspectRatio();
        });
        $img->save($path);
    }
}
开发者ID:strebl,项目名称:teamspeak3-country-flags,代码行数:18,代码来源:index.php


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