zoukankan      html  css  js  c++  java
  • Laravel创建Route

    <?php
    /*
    |--------------------------------------------------------------------------
    | Routes File
    |--------------------------------------------------------------------------
    |
    | Here is where you will register all of the routes in an application.
    | It's a breeze. Simply tell Laravel the URIs it should respond to
    | and give it the controller to call when that URI is requested.
    |
    */
    //直接调用视图模板
    Route::get('/', function () {
        return view('welcome.welcome');
    });
    //调用控制器中的方法
    Route::get('test1','PeopelController@say');
    Route::get('name','User@getName');
    //直接在路由中使用某个方法
    Route::get('hello',function (){
        return '你好';
    });
    /*
    |--------------------------------------------------------------------------
    | Application Routes
    |--------------------------------------------------------------------------
    |
    | This route group applies the "web" middleware group to every route
    | it contains. The "web" middleware group is defined in your HTTP
    | kernel and includes session state, CSRF protection, and more.
    |
    */
    Route::group(['middleware' => ['web']], function () {
        //
    });
    
  • 相关阅读:
    GTD时间管理(1)---捕获搜集
    ios面试总结-
    Swift入门篇-结构体
    Swift入门篇-闭包和函数
    swift入门篇-函数
    Swift入门篇-集合
    Swift入门篇-循环语句
    Swift入门篇-基本类型(3)
    Swift入门篇-基本类型(2)
    Swift入门篇-基本类型(1)
  • 原文地址:https://www.cnblogs.com/zheng-chuang/p/6660224.html
Copyright © 2011-2022 走看看