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


PHP Setting::getSetting方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $v = Validator::make($request->all(), ['username' => 'required|unique:users|alpha_num', 'email' => 'required|unique:users|email', 'emailConfirmation' => 'required|same:email', 'password' => 'required', 'passwordConfirmation' => 'required|same:password', 'tos' => 'required']);
     //recaptcha implementation
     $recaptcha = new \ReCaptcha\ReCaptcha(Setting::getSetting('recaptchasecret'));
     $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
     //dd($resp);
     if ($v->fails() || $resp->isSuccess() == false) {
         if ($resp->isSuccess() == false) {
             $v->errors()->add('g-recaptcha', 'Би машин биш гэсэн чагтыг тэмдэглэнэ үү');
         }
         $errors = $v->errors();
         $return['status'] = false;
         $return['errors'] = $errors;
         //return redirect('/user/register')->back()->withErrors($v->errors())->withInput($request->except('password'));
     } else {
         $user = new User();
         $user->email = $request->input('email');
         $user->password = Hash::make($request->input('password'));
         $user->register_ip = $_SERVER['REMOTE_ADDR'];
         $user->registered_with = 'local';
         $user->public = 0;
         $user->status = 1;
         $user->role = 2;
         $user->save();
         $this->sendThankYouEmail($user);
         Auth::login($user, true);
         $return['status'] = true;
         $return['url'] = url('/user/profile/' . $user->usr_id);
     }
     return $return;
 }
开发者ID:sordev,项目名称:bootup,代码行数:37,代码来源:UserController.php

示例2: BuildLayout

 public function BuildLayout()
 {
     $settings = Setting::allSetting();
     $navigations = ['super' => [['title' => 'Төслүүд', 'url' => url('projects')], ['title' => 'Төсөл нэмэх', 'url' => url('project/add')], ['title' => 'Бидний тухай', 'url' => url('about-us')]], 'user' => [['title' => 'Нэвтрэх', 'url' => '#', 'attributes' => ['data-toggle' => 'modal', 'data-target' => '#loginModal']], ['title' => 'Бүртгүүлэх', 'url' => '#', 'attributes' => ['data-toggle' => 'modal', 'data-target' => '#registerModal']]], 'about' => [['title' => 'Блог', 'url' => url('blog')], ['title' => 'Хамтран ажиллагсад', 'url' => url('about-partners')], ['title' => 'Дэмжигчид', 'url' => url('about-supporters')], ['title' => 'Үйлчилгээний нөхцөл', 'url' => url('tos')]], 'help' => [['title' => 'Түгээмэл асуулт, хариулт', 'url' => url('faq')], ['title' => 'Хэрхэн хөрөнгө оруулах', 'url' => url('funding')], ['title' => 'Төслийн шалгуур', 'url' => url('requirment')]]];
     $categories = \App\Category::where('type', 1)->get();
     foreach ($categories as $c) {
         $navigations['categories'][] = ['title' => $c->title, 'url' => $c->url];
     }
     if ($this->user) {
         $navigations['profile'] = [['title' => 'Миний төслүүд', 'url' => url('user/projects')], ['title' => 'Дэмжсэн төслүүд', 'url' => url('user/support')], ['title' => 'Бүртгэлийн тохиргоо', 'url' => url('user/edit/profile')], ['title' => 'Нууц үг солих', 'url' => url('user/edit/profile/password')]];
         $navigations['user'] = [['title' => 'Миний бүртгэл', 'url' => url('user/profile'), 'child' => $navigations['profile']], ['title' => 'Гарах', 'url' => url('user/logout')]];
         $navigations['admin'] = [['title' => 'Төслүүд', 'url' => url('admin/projects')], ['title' => 'Ангилалууд', 'url' => url('admin/categories')], ['title' => 'Агуулгууд', 'url' => url('admin/content')]];
         if ($this->user->role == 1) {
             $navigations['user'][] = ['title' => 'Админ цэс', 'url' => url('admin'), 'child' => $navigations['admin']];
         }
     }
     $recaptchakey = Setting::getSetting('recaptchakey');
     $this->view = view($this->layout)->withStyles($this->styles)->withScripts($this->scripts)->withSettings($settings)->withMetas($this->metas)->withNavigations($navigations)->with('recaptchakey', $recaptchakey);
     if ($this->user) {
         $this->view->withUserlevel($this->user->usr_level);
     }
     return $this->view;
     // Run the 'csrf' filter on all post, put, patch and delete requests.
     //$this->beforeFilter('csrf', ['on' => ['post', 'put', 'patch', 'delete']]);
 }
开发者ID:sordev,项目名称:bootup,代码行数:25,代码来源:Controller.php


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