view不会显示相同的结果

ql3eal8s  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(342)

嗨,我试图实现一个代码,我可以过滤成员的角色或名称这是我在控制器的功能
profilecontrolle.php文件:

public function membrevis()
  {
      $filter = isset($_GET['filter']) ? $_GET['filter'] : null;
      $query = DB::table('users')
          ->join('user_role', 'users.id', '=', 'user_role.user_id')
          ->join('roles', 'user_role.role_id', '=', 'roles.id')
          ->where('users.valid','=',0)
          ->select('users.*','roles.description');
      if ($filter != null) {
          $query->where('users.name','like','%'.$filter.'%')
             ->orWhere('roles.description','like','%'.$filter.'%');
      }

      $users = $query->get();

      return view('membre2',['users'=> $users]); 
  }

我的观点是一个刀片扩展的布局有以下代码:

@extends('layouts.edu')

 @section('content')
 <div class="container">     
     <div class="row">

         <form action="/profilecontroller/membrevis" method="get">
             <input type="text" name="filter" >
             <button type="submit">filter</button>
         </form>

         @foreach($users as $user) 
             <h4 class="media-heading">{{ $user->name }}</h4>
         @endforeach

     </div>
</div>
@endsection

问题是,自从我启动函数membrevis()以来,它就改变了我的视图,尽管我有这样一个问题:

return view('membre2',['users'=> $users]);

这意味着视图membre2上有请求和结果。。
有人能告诉我如何将这个命令行更改为一个otehr命令行,这样即使在启动函数之后,我的刀片也能保持原样吗?谢谢您

返回的html代码**************

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

<head>
  <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta name="description" content="Creative - Bootstrap 3 Responsive Admin Template">
  <meta name="author" content="GeeksLabs">
   <meta name="keyword" content="Creative, Dashboard, Admin, Template, Theme, Bootstrap, Responsive, Retina, Minimal">
   <link rel="shortcut icon" href="img/favicon.png">

  <title>Cours DZ</title>

  <!-- Bootstrap CSS -->
  <link href="css/bootstrap.min.css" rel="stylesheet">
 <!-- bootstrap theme -->
 <link href="css/bootstrap-theme.css" rel="stylesheet">
  <!--external css-->
   <!-- font icon -->
   <link href="css/elegant-icons-style.css" rel="stylesheet" />
  <link href="css/font-awesome.min.css" rel="stylesheet" />
 <!-- full calendar css-->
  <link href="assets/fullcalendar/fullcalendar/bootstrap-fullcalendar.css" rel="stylesheet" />
    <link href="assets/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" />
     <!-- easy pie chart-->
  <link href="assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css" media="screen" />
  <!-- owl carousel -->
   <link rel="stylesheet" href="css/owl.carousel.css" type="text/css">
   <link href="css/jquery-jvectormap-1.2.2.css" rel="stylesheet">
  <!-- Custom styles -->
   <link rel="stylesheet" href="css/fullcalendar.css">
  <link href="css/widgets.css" rel="stylesheet">
 <link href="css/style.css" rel="stylesheet">
  <link href="css/style-responsive.css" rel="stylesheet" />
 <link href="css/xcharts.min.css" rel=" stylesheet">
  <link href="css/jquery-ui-1.10.4.min.css" rel="stylesheet">
  <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta name="description" content="Creative - Bootstrap 3 Responsive Admin Template">
   <meta name="author" content="GeeksLabs">
 <meta name="keyword" content="Creative, Dashboard, Admin, Template, Theme, Bootstrap, Responsive, Retina, Minimal">
 <link rel="shortcut icon" href="img/favicon.png">
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

 <!-- Bootstrap CSS -->
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <!-- bootstrap theme -->
  <link href="css/bootstrap-theme.css" rel="stylesheet">
  <!--external css-->
  <!-- font icon -->
  <link href="css/elegant-icons-style.css" rel="stylesheet" />
 <link href="css/font-awesome.css" rel="stylesheet" />
  <!-- Custom styles -->
  <link href="css/style.css" rel="stylesheet">
 <link href="css/style-responsive.css" rel="stylesheet" />

  <!-- =======================================================
  Theme Name: NiceAdmin
Theme URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
 Author: BootstrapMade
  Author URL: https://bootstrapmade.com

======================================================= -->

<body>
   <!-- container section start -->
  <section id="container" class="">

  <header class="header dark-bg">
  <div class="toggle-nav">
    <div class="icon-reorder tooltips" data-original-title="Toggle Navigation" data-placement="bottom"><i class="icon_menu"></i></div>
  </div>

  <!--logo start-->
  <a href="http://127.0.0.1:8001" class="logo">COURS <span class="lite">DZ</span></a>
  <!--logo end-->
   <div class="top-nav notification-row">
    <!-- notificatoin dropdown start-->
    <ul class="nav pull-right top-menu">

      <!-- task notificatoin start -->
    <li> <div class="nav search-row" id="top_menu">
    <!--  search form start -->
    <ul class="nav top-menu">

    <a href="http://127.0.0.1:8001/login"> <button type="button" class="btn dark-bg"><font size = "3" face = "Times new roman" color = "white">CONNEXION </font></button></a>

  <!--logo end-->
      <li>
        <form class="navbar-form">
          <input class="form-control" placeholder="Rechercher" type="text">
        </form>
      </li>
    </ul>
    <!--  search form end -->
  </div>
         </li> 

        </ul>
      </li>

      </li>

     </ul></div>
       </header>
   <!--header end-->

   <!--sidebar start-->
   <aside>
  <div id="sidebar" class="nav-collapse ">
    <!-- sidebar menu start-->
    <ul class="sidebar-menu">
      <li class="active">
        <a class="" href="http://127.0.0.1:8001">
                      <i class="icon_house_alt"></i>
                      <span>Page d'acceuil</span>
                  </a>
      </li>
      <li>
        <a href="http://127.0.0.1:8001/cours">
                      <i class="icon_document_alt"></i>
                      <span>Cours</span>

                  </a>
      </li>
      <li>
        <a href="http://127.0.0.1:8001/evenement">
                      <i class="icon_table"></i>
                      <span>Evènements</span>

                  </a> </li>
      <li>
        <a href="http://127.0.0.1:8001/groupevis">
                      <i class="icon_group"></i>
                      <span>Groupes</span>
                  </a>
      </li>
      <li>
        <a href="http://127.0.0.1:8001/membre2">
                      <i class="icon_documents_alt"></i>
                      <span>Membres</span>

                  </a>

      </li>

      <li class="sub-menu">
        <a href="javascript:;" class="">
                      <i class="icon_piechart"></i>
                      <span>Statistiques</span>

                  </a>

    </ul>
    <!-- sidebar menu end-->
  </div>
   </aside>
   <!--sidebar end-->

   <!--main content start-->
   <section id="main-content">
  <section class="wrapper">
     <!--overview start-->
    <div class="row">
      <div class="col-lg-12">
        <h3 class="page-header"><i class="fa fa-laptop"></i> Page d'acceuil</h3>
        <ol class="breadcrumb">

          <li><i class="fa fa-home"></i><a href="http://127.0.0.1:8001">Cours DZ</a></li>
          <li><i class="fa fa-laptop"></i>Page d'acceuil</li>
        </ol>
      </div>
    </div>

    <div>   </div>  

   <div class="container">     
   <div class="row">

    <form action="/profilecontroller/membrevis" method="get">

     <input type="text" name="filter" >
                   <button type="submit">filter</button>
                                  </form> <br><br>

    </div>
    </div>
     </div>
      </section>
    <!--main content end-->
     </section>
     <!-- container section start -->

    <!-- javascripts -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

  <script src="http://127.0.0.1:8001/js/like.js"></script>
 <script type="text/javascript">

   var url = "http://127.0.0.1:8001/like";
  var url_dis = "http://127.0.0.1:8001/dislike";
  var token = "7HRazckkC7aUoYpcRZKhN2xuC0UqX8QQxS6Ibn6X";
    </script>

  <script src="js/jquery.js"></script>
 <script src="js/jquery-ui-1.10.4.min.js"></script>
 <script src="js/jquery-1.8.3.min.js"></script>
 <script type="text/javascript" src="js/jquery-ui-1.9.2.custom.min.js"> 
   </script>
    <!-- bootstrap -->
    <script src="js/bootstrap.min.js"></script>
   <!-- nice scroll -->
  <script src="js/jquery.scrollTo.min.js"></script>
   <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
   <!-- charts scripts -->
  <script src="assets/jquery-knob/js/jquery.knob.js"></script>
  <script src="js/jquery.sparkline.js" type="text/javascript"></script>
  <script src="assets/jquery-easy-pie-chart/jquery.easy-pie-chart.js"> 
  </script>
 <script src="js/owl.carousel.js"></script>
 <!-- jQuery full calendar -->
  <script src="js/fullcalendar.min.js"></script>
 <!-- Full Google Calendar - Calendar -->
 <script src="assets/fullcalendar/fullcalendar/fullcalendar.js"></script>
 <!--script for this page only-->
 <script src="js/calendar-custom.js"></script>
 <script src="js/jquery.rateit.min.js"></script>
 <!-- custom select -->
 <script src="js/jquery.customSelect.min.js"></script>
 <script src="assets/chart-master/Chart.js"></script>

  <!--custome script for all page-->
 <script src="js/scripts.js"></script>
  <!-- custom script for this page-->
   <script src="js/sparkline-chart.js"></script>
   <script src="js/easy-pie-chart.js"></script>
   <script src="js/jquery-jvectormap-1.2.2.min.js"></script>
   <script src="js/jquery-jvectormap-world-mill-en.js"></script>
   <script src="js/xcharts.min.js"></script>
   <script src="js/jquery.autosize.min.js"></script>
   <script src="js/jquery.placeholder.min.js"></script>
   <script src="js/gdp-data.js"></script>
  <script src="js/morris.min.js"></script>
   <script src="js/sparklines.js"></script>
   <script src="js/charts.js"></script>
   <script src="js/jquery.slimscroll.min.js"></script>
   <script>
  //knob
  $(function() {
    $(".knob").knob({
      'draw': function() {
        $(this.i).val(this.cv + '%')
      }
    })
  });

  //carousel
  $(document).ready(function() {
    $("#owl-slider").owlCarousel({
      navigation: true,
      slideSpeed: 300,
      paginationSpeed: 400,
      singleItem: true

    });
  });

  //custom select box

  $(function() {
    $('select.styled').customSelect();
  });

  /* ---------- Map ---------- */
  $(function() {
    $('#map').vectorMap({
      map: 'world_mill_en',
      series: {
        regions: [{
          values: gdpData,
          scale: ['#000', '#000'],
          normalizeFunction: 'polynomial'
        }]
      },
      backgroundColor: '#eef3f7',
      onLabelShow: function(e, el, code) {
        el.html(el.html() + ' (GDP - ' + gdpData[code] + ')');
      }
    });
  });
   </script>

     </body>

   </html>
1tu0hz3e

1tu0hz3e1#

问题可能出在布局文件上,您关闭1个div的次数超出了需要,这可能是您看到html混乱的原因,因此请尝试从布局文件中删除一个正在中断html的关闭标记:

</div> // close row
</div> // close container
 </div> // this is closing nothing therefore it should be removed from layout file 
  </section>

在layout.edu文件检查中,在生成“content”部分后,您可能会发现1个结束div标记,然后需要删除它

相关问题