当前位置: 首页>>代码示例>>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;未经允许,请勿转载。