Skip to content

Instantly share code, notes, and snippets.

@Rokt33r
Last active August 29, 2015 13:57
Show Gist options
  • Save Rokt33r/9861712 to your computer and use it in GitHub Desktop.
Save Rokt33r/9861712 to your computer and use it in GitHub Desktop.
Laravel 基礎 Lesson 5 - Blade & Helper (app/views/posts/index.blade.php)
@extends('layouts.master')
@section('title')
Posts list - mylaravel
@stop
@section('body')
<h1>Posts list {{link_to('posts/create','create a new post'))}}</h1>
<ul>
@foreach($posts as $post)
<h2>{{link_to('posts/'.$post->id,$post->title)}}
</h2>
<p>{{$post->body}}</p>
@endforeach
</ul>
@stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment