2017-06-03 17 views
-1

のビューをロードしませんview.Itをロードしていない空のページが表示されます。つまり、HTMLは機能しません。しかし、私はルートから管理者を削除した場合、ポストルートには問題ありません。例:Laravelは私が作成した私のlaravelブログプロジェクトでルートを特定のルート

Route::get('/post','[email protected]'); 

私はそれを取得しません。なぜこうなった?もしあなたがそれを取得したら教えてください。ここに私のpost.blade.phpは管理フォルダ内にある:

@extends('layouts.header') 
@section('title','postsss') 
@section('body') 
    <p>This is for posting</p> 
@stop 

そしてここでは、レイアウトフォルダ内の私のheader.blade.phpです:あなたのルートの

<!DOCTYPE html> 
 
<html lang="en"> 
 

 
<head> 
 
    <meta charset="utf-8"> 
 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <meta name="description" content=""> 
 
    <meta name="author" content=""> 
 
    <link rel="icon" type="image/png" sizes="16x16" href="../plugins/images/favicon.png"> 
 
    <title>@yield('title')</title> 
 
    <!-- Bootstrap Core CSS --> 
 
    <link href="bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> 
 
    <!-- Menu CSS --> 
 
    <link href="../plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.css" rel="stylesheet"> 
 
    <!-- toast CSS --> 
 
    <link href="../plugins/bower_components/toast-master/css/jquery.toast.css" rel="stylesheet"> 
 
    <!-- morris CSS --> 
 
    <link href="../plugins/bower_components/morrisjs/morris.css" rel="stylesheet"> 
 
    <!-- chartist CSS --> 
 
    <link href="../plugins/bower_components/chartist-js/dist/chartist.min.css" rel="stylesheet"> 
 
    <link href="../plugins/bower_components/chartist-plugin-tooltip-master/dist/chartist-plugin-tooltip.css" rel="stylesheet"> 
 
    <!-- animation CSS --> 
 
    <link href="css/animate.css" rel="stylesheet"> 
 
    <!-- Custom CSS --> 
 
    <link href="css/style.css" rel="stylesheet"> 
 
    <!-- color CSS --> 
 
    <link href="css/colors/default.css" id="theme" rel="stylesheet"> 
 
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> 
 
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> 
 
    <!--[if lt IE 9]> 
 
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> 
 
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> 
 
<![endif]--> 
 
</head> 
 

 
<body class="fix-header"> 
 
    <!-- ============================================================== --> 
 
    <!-- Preloader --> 
 
    <!-- ============================================================== --> 
 
    <div class="preloader"> 
 
     <svg class="circular" viewBox="25 25 50 50"> 
 
      <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" /> 
 
     </svg> 
 
    </div> 
 
    <!-- ============================================================== --> 
 
    <!-- Wrapper --> 
 
    <!-- ============================================================== --> 
 
    <div id="wrapper"> 
 
     <!-- ============================================================== --> 
 
     <!-- Topbar header - style you can find in pages.scss --> 
 
     <!-- ============================================================== --> 
 
     <nav class="navbar navbar-default navbar-static-top m-b-0"> 
 
      <div class="navbar-header"> 
 
       <div class="top-left-part"> 
 
        <!-- Logo --> 
 
        <a class="logo" href="index.html"> 
 
         <!-- Logo icon image, you can use font-icon also --><b> 
 
         <!--This is dark logo icon--><img src="../plugins/images/admin-logo.png" alt="home" class="dark-logo" /><!--This is light logo icon--><img src="../plugins/images/admin-logo-dark.png" alt="home" class="light-logo" /> 
 
        </b> 
 
         <!-- Logo text image you can use text also --><span class="hidden-xs"> 
 
         <!--This is dark logo text--><img src="../plugins/images/admin-text.png" alt="home" class="dark-logo" /><!--This is light logo text--><img src="../plugins/images/admin-text-dark.png" alt="home" class="light-logo" /> 
 
        </span> </a> 
 
       </div> 
 
       <!-- /Logo --> 
 
       <ul class="nav navbar-top-links navbar-right pull-right"> 
 
        <li> 
 
         <form role="search" class="app-search hidden-sm hidden-xs m-r-10"> 
 
          <input type="text" placeholder="Search..." class="form-control"> <a href=""><i class="fa fa-search"></i></a> </form> 
 
        </li> 
 
        <li> 
 
         <a class="profile-pic" href="#"> <img src="../plugins/images/users/varun.jpg" alt="user-img" width="36" class="img-circle"><b class="hidden-xs">Steave</b></a> 
 
        </li> 
 
       </ul> 
 
      </div> 
 
      <!-- /.navbar-header --> 
 
      <!-- /.navbar-top-links --> 
 
      <!-- /.navbar-static-side --> 
 
     </nav> 
 
     <!-- End Top Navigation --> 
 
     <!-- ============================================================== --> 
 
     <!-- Left Sidebar - style you can find in sidebar.scss --> 
 
     <!-- ============================================================== --> 
 
     <div class="navbar-default sidebar" role="navigation"> 
 
      <div class="sidebar-nav slimscrollsidebar"> 
 
       <div class="sidebar-head"> 
 
        <h3><span class="fa-fw open-close"><i class="ti-close ti-menu"></i></span> <span class="hide-menu">Navigation</span></h3> 
 
       </div> 
 
       <ul class="nav" id="side-menu"> 
 
        <li style="padding: 70px 0 0;"> 
 
         <a href="index.blade.php" class="waves-effect"><i class="fa fa-clock-o fa-fw" aria-hidden="true"></i>Dashboard</a> 
 
        </li> 
 
        <li> 
 
         <a href="profile.blade.php" class="waves-effect"><i class="fa fa-user fa-fw" aria-hidden="true"></i>Profile</a> 
 
        </li> 
 
        <li> 
 
         <a href="basic-table.blade.php" class="waves-effect"><i class="fa fa-table fa-fw" aria-hidden="true"></i>Basic Table</a> 
 
        </li> 
 
        <li> 
 
         <a href="fontawesome.blade.php" class="waves-effect"><i class="fa fa-font fa-fw" aria-hidden="true"></i>Icons</a> 
 
        </li> 
 
        <li> 
 
         <a href="map-google.blade.php" class="waves-effect"><i class="fa fa-globe fa-fw" aria-hidden="true"></i>Google Map</a> 
 
        </li> 
 
        <li> 
 
         <a href="blank.blade.php" class="waves-effect"><i class="fa fa-columns fa-fw" aria-hidden="true"></i>Blank Page</a> 
 
        </li> 
 
        <li> 
 
         <a href="admin/post" class="waves-effect"><i class="fa fa-columns fa-fw" aria-hidden="true"></i>Post Page</a> 
 
        </li> 
 
        <li> 
 
         <a href="404.blade.php" class="waves-effect"><i class="fa fa-info-circle fa-fw" aria-hidden="true"></i>Error 404</a> 
 
        </li> 
 

 
       </ul> 
 
       <div class="center p-20"> 
 
        <a href="https://wrappixel.com/templates/ampleadmin/" target="_blank" class="btn btn-danger btn-block waves-effect waves-light">Upgrade to Pro</a> 
 
       </div> 
 
      </div> 
 
      
 
     </div> 
 
     <!-- ============================================================== --> 
 
     <!-- End Left Sidebar --> 
 
     <!-- ============================================================== --> 
 
     <!-- ============================================================== --> 
 
     <!-- Page Content --> 
 
     <!-- ============================================================== --> 
 
     @section('body') 
 
     @show 
 
       <!-- /.row --> 
 
       <!-- ============================================================== --> 
 
       <!-- Different data widgets --> 
 
       <!-- ============================================================== --> 
 
       <!-- .row --> 
 
       
 
      <!-- /.container-fluid --> 
 
      <footer class="footer text-center"> 2017 &copy; Ample Admin brought to you by wrappixel.com </footer> 
 
     </div> 
 
     <!-- ============================================================== --> 
 
     <!-- End Page Content --> 
 
     <!-- ============================================================== --> 
 
    </div> 
 
    <!-- ============================================================== --> 
 
    <!-- End Wrapper --> 
 
    <!-- ============================================================== --> 
 
    <!-- ============================================================== --> 
 
    <!-- All Jquery --> 
 
    <!-- ============================================================== --> 
 
    <script src="../plugins/bower_components/jquery/dist/jquery.min.js"></script> 
 
    <!-- Bootstrap Core JavaScript --> 
 
    <script src="bootstrap/dist/js/bootstrap.min.js"></script> 
 
    <!-- Menu Plugin JavaScript --> 
 
    <script src="../plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.js"></script> 
 
    <!--slimscroll JavaScript --> 
 
    <script src="js/jquery.slimscroll.js"></script> 
 
    <!--Wave Effects --> 
 
    <script src="js/waves.js"></script> 
 
    <!--Counter js --> 
 
    <script src="../plugins/bower_components/waypoints/lib/jquery.waypoints.js"></script> 
 
    <script src="../plugins/bower_components/counterup/jquery.counterup.min.js"></script> 
 
    <!-- chartist chart --> 
 
    <script src="../plugins/bower_components/chartist-js/dist/chartist.min.js"></script> 
 
    <script src="../plugins/bower_components/chartist-plugin-tooltip-master/dist/chartist-plugin-tooltip.min.js"></script> 
 
    <!-- Sparkline chart JavaScript --> 
 
    <script src="../plugins/bower_components/jquery-sparkline/jquery.sparkline.min.js"></script> 
 
    <!-- Custom Theme JavaScript --> 
 
    <script src="js/custom.min.js"></script> 
 
    <script src="js/dashboard1.js"></script> 
 
    <script src="../plugins/bower_components/toast-master/js/jquery.toast.js"></script> 
 
</body> 
 

 
</html>

+0

"ただし、ビューを読み込んでいません。" ..それは何してるの?何らかのエラーが発生しているはずです。 'artisan route:list'を使用して、競合があるかどうかを確認するためにルートの完全なリストをダンプすることをお勧めします。 – Devon

+0

それは空のページを示しています。そして、ルートリストは細かいです – Gias

答えて

0

両方されています同じ方法を指している[email protected]

admin/postルートでは、別のビュー、または同じビューでレンダリングされた別のデータセットを指す新しいメソッドを作成する必要があります。あなたのルートファイル中のSO

例えば

...

web.phpコントローラ内で次に

Route::get('/admin/post','[email protected]'); 
Route::get('/post','[email protected]'); 

...あなたのビューで次に

namespace App\Http\Controllers; 
use Illuminate\Http\Request; 

class newController extends Controller 
{ 
    public function adminPost() 
    { 
     return view('admin.post'); 
    } 
    public function post() 
    { 
     return view('post'); 
    } 
} 

post.blade.phpadmin\post.blade.phpの両方を持つ必要があります(この場合、別のpost.blade.phpを含む管理フォルダあなたの説明に基づいてASE)

+0

私はルート管理者/ポストを1つしか持っていませんが、私が管理者を削除するとそれは/ postルート – Gias

0

、私はそれが私はそれが動作するはずだと思う。この

Route::get('/admin/post','[email protected]'); 

ようになりますので、あなたのルートで/を追加してみなければならないと思います。

関連する問題