欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

laravel route

程序员文章站 2022-06-15 16:01:37
...

laravel route

to config your route in your router/web.php


example one:
detail route

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

laravel route

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");
});

laravel route

dynamist route

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

laravel route


optionad route

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

laravel route

if you do not pass paramter to route,it will

laravel route


laravel route