简体   繁体   中英

Laravel 5 - Sending a variable through an href with a route inside

I have this code:

@foreach($clientes as $cli)
  <tr>

      <td>{{$cli->id}}</td>
      <td>{{$cli->nome}}</td>
      <td>{{$cli->bi}}</td>
      <td>{{$cli->telefone}}</td>
      <td>{{$cli->morada}}</td>
      <td>{{$cli->cp}}</td>
      <td>{{$cli->email}}</td>
      <td>{{$cli->valido}}</td>
      //<td><a href="{{$url = route('a_clientes'){{$cli->id}}"></td>
</tr>
@endforeach

I want to edit the line with the //.

What I need to do is create a new column in the table with an href inside that redirects the user to a page where he can change the record of the $cli with that id.

语法有点差...

<td><a href="{{ route('a_clientes', $cli->id ) }}">Edit</a></td>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM