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


PHP Location::states方法代碼示例

本文整理匯總了PHP中app\models\Location::states方法的典型用法代碼示例。如果您正苦於以下問題:PHP Location::states方法的具體用法?PHP Location::states怎麽用?PHP Location::states使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\Location的用法示例。


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

示例1: create

 public function create($category = 0)
 {
     $category = intval($category);
     if ($category > 0) {
         $category = Category::findOrFail($category);
     }
     $categories = Category::roots()->get();
     $user = Auth::user();
     $states = Location::states()->first();
     $regions = $states->children()->first();
     $locations = $regions->children;
     return view('pages.task.create', compact('category', 'categories', 'user', 'locations'));
 }
開發者ID:blozixdextr,項目名稱:tuasist2,代碼行數:13,代碼來源:TaskController.php

示例2: create

 public function create()
 {
     $pid = intval(Input::get('id', 0));
     if ($pid != 0) {
         $location = Location::findOrFail($pid);
         if ($location->pid == 0) {
             $parents = Location::states()->get();
         } else {
             $parents = $location->siblings();
         }
     } else {
         $location = false;
         $parents = Location::states()->get();
     }
     return view('admin.pages.location.add', compact('location', 'parents', 'pid'));
 }
開發者ID:blozixdextr,項目名稱:tuasist2,代碼行數:16,代碼來源:LocationController.php

示例3: getFill

 public function getFill()
 {
     if (!$this->checkProfileType()) {
         return redirect('/profile');
     }
     if ($this->checkProfileFill()) {
         return redirect('/profile');
     }
     $user = $this->user;
     $profile = $this->user->profile;
     $city = $profile->city;
     if ($city) {
         $region = $city->parent;
     } else {
         $region = Location::states()->first()->children()->first();
     }
     $cities = $region->children;
     $categories = Category::roots()->get();
     $subscribePeriods = ['asap', 'hour', 'twice-day', 'day', 'two-days'];
     return view('pages.profile.fill', compact('user', 'profile', 'cities', 'categories', 'subscribePeriods'));
 }
開發者ID:blozixdextr,項目名稱:tuasist2,代碼行數:21,代碼來源:ProfileController.php

示例4: getRegisterTasker

 public function getRegisterTasker()
 {
     $states = Location::states()->get();
     $regions = $states->first()->children;
     $cities = $regions->first()->children;
     $citiesArr = ['' => trans('register.city.placeholder')];
     $regionsArr = [];
     $statesArr = [];
     foreach ($cities as $s) {
         $citiesArr[$s->id] = $s->title;
     }
     foreach ($regions as $s) {
         $regionsArr[$s->id] = $s->title;
     }
     foreach ($states as $s) {
         $statesArr[$s->id] = $s->title;
     }
     $cities = $citiesArr;
     $states = $statesArr;
     $regions = $regionsArr;
     return view('pages.register.tasker', compact('states', 'regions', 'cities'));
 }
開發者ID:blozixdextr,項目名稱:tuasist2,代碼行數:22,代碼來源:AuthController.php


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