laravel route

to config your route in your router/web.php


example one:
detail route

Route:get("/hello",function(){
    echo "hello world";
});

blade template map ;
you should create a file named hello.php in your views/hello.blade.php
hello..blade.php

<?php
    echo "hello world";
?>

route:

Route.get("/hello",function({
   return view("hello");
});

dynamist route

Route::get("/id/{id}",function($id){
    echo $id;
});


optionad route

Route::get("/option/{name?}",function($name="abcd"){
    echo $name;
});

if you do not pass paramter to route,it will

扫描二维码关注公众号,回复: 4128610 查看本文章

猜你喜欢

转载自www.cnblogs.com/cyany/p/9977376.html
今日推荐