Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f373c02

Browse files
Finish static pages
1 parent 56cf7dc commit f373c02

File tree

7 files changed

+54
-60
lines changed

7 files changed

+54
-60
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
use App\Http\Requests;
8+
use App\Http\Controllers\Controller;
9+
10+
class StaticPagesController extends Controller
11+
{
12+
public function home()
13+
{
14+
return view('static_pages/home');
15+
}
16+
17+
public function help()
18+
{
19+
return view('static_pages/help');
20+
}
21+
22+
public function about()
23+
{
24+
return view('static_pages/about');
25+
}
26+
}

‎app/Http/routes.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
<?php
2-
3-
/*
4-
|--------------------------------------------------------------------------
5-
| Application Routes
6-
|--------------------------------------------------------------------------
7-
|
8-
| Here is where you can register all of the routes for an application.
9-
| It's a breeze. Simply tell Laravel the URIs it should respond to
10-
| and give it the controller to call when that URI is requested.
11-
|
12-
*/
13-
14-
Route::get('/', function () {
15-
return view('welcome');
16-
});
2+
get('/', 'StaticPagesController@home');
3+
get('/help', 'StaticPagesController@help');
4+
get('/about', 'StaticPagesController@about');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>@yield('title', 'Sample App') - Laravel 入门教程</title>
5+
</head>
6+
<body>
7+
@yield('content')
8+
</body>
9+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@extends('layouts.default')
2+
@section('title', '关于')
3+
4+
@section('content')
5+
<h1>关于页</h1>
6+
@stop
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@extends('layouts.default')
2+
@section('title', '帮助')
3+
4+
@section('content')
5+
<h1>帮助页</h1>
6+
@stop
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@extends('layouts.default')
2+
@section('content')
3+
<h1>主页</h1>
4+
@stop

‎resources/views/welcome.blade.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /