本文整理汇总了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');
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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("/");
}
}
示例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);
}
示例10: getEdit
public function getEdit()
{
return Controller::myView('auth.edit');
}
示例11: getRegister
/**
* Show the application registration form.
*
* @return \Illuminate\Http\Response
*/
public function getRegister()
{
return Controller::myView('auth.register');
}
示例12: showCateUpdate
public function showCateUpdate()
{
if (Auth::user()->role !== 1) {
return redirect('/');
}
return Controller::myView('admin_book.cate');
}
示例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);
}