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


PHP view函数代码示例

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


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

示例1: pending_leads_by_source

 public function pending_leads_by_source()
 {
     $data_sources = $this->reporting->pendingLeadsBySource()->lists('label');
     $data_count = $this->reporting->pendingLeadsBySource()->lists('data');
     $leads = $this->reporting->allPendingBySource();
     return view('admin.leadrouter.pending_leads_by_source', compact('leads', 'data_sources', 'data_count'));
 }
开发者ID:jdelise,项目名称:career_site,代码行数:7,代码来源:ReportingController.php

示例2: getValidateToken

 /**
  *
  * @return \Illuminate\Http\Response
  */
 public function getValidateToken()
 {
     if (session('2fa:user:id')) {
         return view('2fa/validate');
     }
     return redirect('login');
 }
开发者ID:cwt137,项目名称:google-laravel-2fa,代码行数:11,代码来源:AuthController.php

示例3: dashboard

 /**
  * Page Acceuil
  */
 public function dashboard()
 {
     // $redirectUrl = $response->links[1]->href;
     $nbacteurs = Actors::count();
     $nbcommentaires = Comments::count();
     $nbmovies = Movies::count();
     $nbseances = Sessions::count();
     $actor = new Actors();
     // Je récpere mon modèle
     $comment = new Comments();
     // Je récpere mon modèle
     $movie = new Movies();
     // Je récpere mon modèle
     $session = new Sessions();
     // Je récpere mon modèle
     $user = new User();
     // Je récpere mon modèle
     $avgacteurs = $actor->getAvgActors();
     $avgnotecommentaire = $comment->getAvgNote();
     $avgnotepresse = $movie->getAvgNotePresse();
     $avghour = $session->getAvgHourDate();
     $seances = $session->getNextSession();
     $users = $user->getLastUsers();
     /*
      $seances = Sessions::where("date_session",  ">", DB::raw("NOW()"))
     ->take(15)->get();
     */
     return view('Main/dashboard', ['avgnotecommentaire' => $avgnotecommentaire->avgnote, 'avgnotepresse' => $avgnotepresse->avgpress, 'avgacteurs' => $avgacteurs->age, 'avghour' => $avghour->avghour, 'nbacteurs' => $nbacteurs, 'nbcommentaires' => $nbcommentaires, 'nbmovies' => $nbmovies, 'nbseances' => $nbseances, 'seances' => $seances, 'users' => $users]);
 }
开发者ID:unpetitlu,项目名称:laravelcinema,代码行数:32,代码来源:MainController.php

示例4: index

 /**
  * @param string $model The model to list.
  * @return mixed
  */
 public function index(Request $request, $model)
 {
     if (!Auth::check()) {
         return response("Unauthorised", 401);
     }
     $user = Auth::user();
     if ($user->cannot('administrate')) {
         return response("Unauthorised", 401);
     }
     $class = $this->getModel($model);
     if (is_null($class)) {
         return response("No items found for this model {$model}", 404);
     }
     $pagination_enabled = config('crudapi.pagination.enabled');
     $perPage = config('crudapi.pagination.perPage');
     if ($pagination_enabled) {
         $items = $class->paginate($perPage);
     } else {
         $items = $class->all();
     }
     $fields = $class->getFillable();
     $data = $this->buildData();
     $data['items'] = $items;
     $data['model'] = $model;
     $data['fields'] = $fields;
     $data['uiframework'] = config('crudapi.framework', 'bs3');
     $data['timestamps'] = config('crudapi.admin.showTimestamps', false);
     $data['show_ids'] = config('crudapi.admin.showIds', false);
     return view('crudapi::admin.index', $data);
 }
开发者ID:azhany,项目名称:crud-api,代码行数:34,代码来源:AdminController.php

示例5: render

 /**
  * Render an exception into an HTTP response.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Exception  $e
  * @return \Illuminate\Http\Response
  */
 public function render($request, Exception $e)
 {
     if ($e instanceof HttpException) {
         return view('errors/404');
     }
     return parent::render($request, $e);
 }
开发者ID:ssddanbrown,项目名称:BookStack-Site,代码行数:14,代码来源:Handler.php

示例6: viewVehicle

 public function viewVehicle(Request $request)
 {
     $user = $request->session()->get('user');
     //Gets buildings
     $vehicles = vehicleModel::where('vehicleOwnerID', '=', $user[0]->id)->get();
     return view('pages.vehicleOwnerVehicles', array('user' => $user, 'vehicles' => $vehicles));
 }
开发者ID:manvimal,项目名称:Logiify,代码行数:7,代码来源:vehicleController.php

示例7: index

 /**
  * Return an index of archived posts.
  *
  * @param PostRepositoryInterface $posts
  * @param                         $year
  * @param null                    $month
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function index(PostRepositoryInterface $posts, $year, $month = null)
 {
     $this->dispatch(new AddPostsBreadcrumb());
     $this->dispatch(new AddArchiveBreadcrumb());
     $posts = $posts->findManyByDate($year, $month);
     return view('anomaly.module.posts::archive/index', compact('year', 'month', 'posts'));
 }
开发者ID:jacksun101,项目名称:posts-module,代码行数:15,代码来源:ArchiveController.php

示例8: store

 public function store(Request $request)
 {
     $postCategory = $request->get('postCategory');
     if ($postCategory == "create") {
         $moduleDetails = BaseHelpers::createModule($request->file('file'));
         $module = ModvelModule::create(['name' => $moduleDetails["name"], 'description' => $moduleDetails["description"], 'category' => $moduleDetails["category"], 'customer' => $moduleDetails["customer"], 'icon' => $moduleDetails["icon"], 'version' => $moduleDetails["version"], 'adminDisplayName' => $moduleDetails["adminDisplayName"], 'adminVisible' => $moduleDetails["adminVisible"], 'adminDisplayOrder' => 0, 'displayName' => $moduleDetails["displayName"], 'displayVisible' => $moduleDetails["displayVisible"], 'displayOrder' => $moduleDetails["displayOrder"]]);
         foreach ($moduleDetails as $k => $v) {
             if (is_array($v)) {
                 if ($v != []) {
                     foreach ($v as $key => $value) {
                         $detail = new ModvelModuleDetail();
                         $detail->moduleId = $module->id;
                         $detail->category = $k;
                         $detail->key = $key;
                         $detail->value = $value;
                         $detail->save();
                     }
                 }
             }
         }
         $datas = ModvelModule::get();
         return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
     }
     $datas = ModvelModule::get();
     return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
 }
开发者ID:furkankadioglu,项目名称:modvel,代码行数:26,代码来源:ModvelModulesAdminController.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     // Validate form
     $this->validate($request, ['user_quantity' => 'required|integer|between:1,100']);
     // Assign variables
     $form_array = $request->input('form_array', array());
     $user_quantity = $request->input('user_quantity');
     // Generate Fake User Data
     $faker = Factory::create('en_US');
     $payload = array();
     $deposit_address = in_array('address', $form_array);
     $deposit_phone = in_array('phone', $form_array);
     $deposit_birthdate = in_array('birthdate', $form_array);
     for ($i = 0; $i < $user_quantity; $i++) {
         $individual = array();
         $individual[] = $faker->name;
         if ($deposit_address) {
             $individual[] = $faker->address;
         }
         if ($deposit_phone) {
             $individual[] = $faker->phoneNumber;
         }
         if ($deposit_birthdate) {
             $individual[] = $faker->date($format = 'Y-m-d', $max = 'now');
         }
         // Append to payload array
         $payload[] = $individual;
     }
     // Push data to view and return view
     return view('results', ['payload' => $payload, 'source' => 'fake-user', 'title' => 'Fake User Generator']);
 }
开发者ID:sietekk,项目名称:cscie15.project3,代码行数:37,代码来源:FakeUserController.php

示例10: index

 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     $gallery = Page::where('slug', '=', 'gallery')->first();
     $images = explode(',', $gallery->content);
     $images = array_slice($images, 0, 16);
     return view('frontend.index', ['images' => $images]);
 }
开发者ID:aysenli,项目名称:laravel5-backend,代码行数:12,代码来源:WelcomeController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $Beatles = ['John', 'Paul', 'George', 'Ringo'];
     //alert()->overlay('Listen', 'I hear Beatle music!', 'success');
     //alert()->error('Problem', 'Cannot hear');
     return view('test.index', compact('Beatles'));
 }
开发者ID:vihugarcia,项目名称:vhglaraboot,代码行数:12,代码来源:TestController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $suppliers = Supplier::orderBy('name')->get();
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('inventory.home', compact(['suppliers', 'employees', 'customers']));
 }
开发者ID:MangTomas23,项目名称:tgm,代码行数:12,代码来源:InventoryController.php

示例13: index

 public function index(WpApiContract $wp_client)
 {
     $posts = $wp_client->getPosts();
     $posts = json_decode($posts);
     //dd($posts);
     return view('layouts.index', compact('posts'));
 }
开发者ID:jedifunk,项目名称:jbfj-laravel-wp-api,代码行数:7,代码来源:WpController.php

示例14: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if ($id) {
         return view('admin/sku/color/modify')->withColor(PhoneColor::find($id));
     }
     return redirect()->back();
 }
开发者ID:pinse98,项目名称:mitao,代码行数:13,代码来源:AdminColorController.php

示例15: postLogin

 public function postLogin(Request $request)
 {
     $this->validate($request, ['username' => 'required', 'password' => 'required']);
     $credentials = $request->only('username', 'password', 'active');
     $employee = Employee::where('username', $credentials['username'])->where('active', true)->first();
     if ($employee != null && password_verify($credentials['password'], $employee->password)) {
         if (!$employee->isadmin) {
             if (getenv('HTTP_X_FORWARDED_FOR')) {
                 $ip = getenv('HTTP_X_FORWARDED_FOR');
             } else {
                 $ip = getenv('REMOTE_ADDR');
             }
             $host = gethostbyaddr($ip);
             $ipAddress = 'Address : ' . $ip . ' Host : ' . $host;
             $count = Ipaddress::where('ip', $ip)->count();
             $today = date("Y-m-d");
             if ($count == 0 || $employee->loginstartdate == null || $today < date('Y-m-d', strtotime($employee->loginstartdate)) || $employee->loginenddate != null && $today > date('Y-m-d', strtotime($employee->loginenddate))) {
                 return view('errors.permissiondenied', ['ipAddress' => $ipAddress]);
             }
             if ($employee->branchid == null) {
                 return redirect($this->loginPath())->withInput($request->only('username', 'remember'))->withErrors(['username' => 'บัญชีเข้าใช้งานของคุณยังไม่ได้ผูกกับสาขา โปรดติดต่อหัวหน้า หรือผู้ดูแล']);
             }
         }
         if ($this->auth->attempt($credentials, $request->has('remember'))) {
             return redirect()->intended($this->redirectPath());
         }
     } else {
         return redirect($this->loginPath())->withInput($request->only('username', 'remember'))->withErrors(['username' => $this->getFailedLoginMessage()]);
     }
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:30,代码来源:AuthController.php


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