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


PHP Controller::myView方法代码示例

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


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

示例1: showCreateFrom

 public function showCreateFrom()
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     return Controller::myView('admin_book.post');
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:7,代码来源:AddBookController.php

示例2: history

 public function history()
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     $orders = Order::where('user_id', '=', Auth::user()->id)->orderBy('id', 'DESC')->get();
     return Controller::myView('admin_order.history')->with('orders', $orders);
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:8,代码来源:AdminOrderController.php

示例3: showRequestList

 public function showRequestList()
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     $requests = Request_book::where('id', '>', 0)->orderBy('id', 'DESC');
     if (!$requests->first()) {
         return Controller::myView('admin_request.request')->with('requests', 1);
     }
     $requests = $requests->paginate(16);
     return Controller::myView('admin_request.request')->with('requests', $requests);
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:12,代码来源:AdminRequestBookController.php

示例4: searchResult

 public function searchResult(Request $request)
 {
     $data = $this->saveRequest($request);
     $books = $this->search($request);
     $books = $books->where('deleted', '=', 0);
     $check = $books->first();
     if (is_null($check)) {
         return Controller::myView('book.search_result')->with('books', '1');
     }
     $books = $books->paginate(6);
     $books->setPath('/search/result');
     $data['books'] = $books;
     return Controller::myView('book.search_result')->with($data);
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:14,代码来源:BookController.php

示例5: show

 public function show()
 {
     if (Auth::guest()) {
         return redirect('auth/login');
     } else {
         $containers = array();
         $container = array();
         $cart = Cart::content();
         foreach ($cart as $item) {
             $containers["{$item->id}"] = ['quantity' => $item->qty, 'book' => Book::find($item->id), 'subtotal' => $item->subtotal];
         }
         return Controller::myView('cart.show')->with('containers', $containers);
     }
 }
开发者ID:TrinhKien94,项目名称:do_cu,代码行数:14,代码来源:CartController.php

示例6: searchResult

 public function searchResult(Request $request)
 {
     $data_request['search_text'] = $request->input('search_text');
     $data_request['price'] = $request->input('price');
     $data_request['author'] = $request->input('author');
     $data_request['title'] = $request->input('title');
     $data_request['check_author'] = $request->input('check_author');
     $data_request['check_price'] = $request->input('check_price');
     $data_request['check_category'] = $request->input('check_category');
     $data_request['categories'] = $request->input('categories');
     $data['request'] = $data_request;
     $books = Book::where('title', 'like', "%" . $request->input('search_text') . "%");
     if (null !== $request->input('check_author')) {
         $books = $books->where('author', 'like', "%" . $request->input('author') . "%");
         // if($request->input('author')==="1"){
         // 	$books= $books->where('title','like', "%".$request->input('search_text')."%");
         // }else{
         // 	$books= $books->where('author','like', "%".$request->input('search_text')."%");
         // }
     }
     if (null != $request->input('check_category')) {
         $books = $books->join('book_book_cates', 'books.id', '=', 'book_book_cates.book_id')->where('book_book_cates.book_cate_id', '=', (int) $request->input('categories'));
     }
     if (null !== $request->input('check_price')) {
         if ($request->input('price') === "0") {
             $books = $books->where('price', '<', 20);
         } else {
             if ($request->input('price') === "1") {
                 $books = $books->where('price', '>=', 20)->where('price', '<=', 50);
             } else {
                 if ($request->input('price') === "2") {
                     $books = $books->where('price', '>=', 50)->where('price', '<=', 100);
                 } else {
                     if ($request->input('price') === "3") {
                         $books = $books->where('price', '>', 100);
                     }
                 }
             }
         }
     }
     // if(null ===$request->input('check_author')&null ===$request->input('check_price')&null ===$request->input('check_category'))
     // 	$books=Book::where('title', 'like', "%".$request->input('search_text')."%" );
     $check = $books->first();
     if (is_null($check)) {
         return Controller::myView('book.search_result')->with('books', '1');
     }
     $books = $books->paginate(6);
     $data['books'] = $books;
     return Controller::myView('book.search_result')->with($data);
 }
开发者ID:TrinhKien94,项目名称:do_cu,代码行数:50,代码来源:BookController.php

示例7: search_user

 public function search_user(Request $request)
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     Session::forget('flash_message');
     $va = $request->input('search_text');
     $n = User::whereNotIN('id', [Auth::user()->id])->where('username', 'like', "%" . $va . "%")->count();
     if ($n < 1) {
         Session::flash('flash_message', 'Không tìm thấy kết quả nào!');
         return Controller::myView('admin_user.admin_users');
     } else {
         $users = User::where('username', 'like', "%" . $va . "%")->whereNotIN('id', [Auth::user()->id])->paginate(6);
         return Controller::myView('admin_user.users')->with('users', $users);
     }
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:16,代码来源:AdminUserController.php

示例8: show

 public function show($id)
 {
     $order = Order::find($id);
     if ($order->user_id === Auth::user()->id) {
         $orderlines = $order->orderlines()->get();
         $containers = array();
         foreach ($orderlines as $orderline) {
             $data = array();
             $data['orderline'] = $orderline;
             $data['book'] = $orderline->book;
             $containers[] = $data;
         }
         return Controller::myView('order.show')->with('containers', $containers)->with('total', $order->money);
     } else {
         return redirect("/");
     }
 }
开发者ID:TrinhKien94,项目名称:bookstore-laravel,代码行数:17,代码来源:OrderController.php

示例9: showUpdateForm

 public function showUpdateForm($id)
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     $this->book = book::where('id', '=', $id)->first();
     $book_book_cates = $this->book->book_book_cates;
     $i = 0;
     $cates = array();
     $book_cates = array();
     $book_cate_ids = array();
     foreach ($book_book_cates as $book_book_cate) {
         $book_cate = $book_book_cate->book_cate;
         $book_cates[$i] = $book_cate->name;
         $book_cate_ids[$i] = $book_cate->id;
         $cate = $book_cate->category;
         $cates[$i] = $cate->name;
         $i++;
     }
     return Controller::myView('admin_book.update')->with("book", $this->book)->with("cates", $cates)->with("book_cate_names", $book_cates)->with("book_cate_ids", $book_cate_ids);
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:21,代码来源:EditBookController.php

示例10: getEdit

 public function getEdit()
 {
     return Controller::myView('auth.edit');
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:4,代码来源:AuthenticatesUsers.php

示例11: getRegister

 /**
  * Show the application registration form.
  *
  * @return \Illuminate\Http\Response
  */
 public function getRegister()
 {
     return Controller::myView('auth.register');
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:9,代码来源:RegistersUsers.php

示例12: showCateUpdate

 public function showCateUpdate()
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     return Controller::myView('admin_book.cate');
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:7,代码来源:AdminBookController.php

示例13: delete_user

 public function delete_user(Request $request)
 {
     $user = User::find((int) $request->input('user_id'));
     $user->delete();
     Session::flash('flash_message', 'Xóa thành công!');
     return Controller::myView('/users')->with('users', $request);
 }
开发者ID:TrinhKien94,项目名称:bookstore-laravel,代码行数:7,代码来源:AdminController.php


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