Laravel 4 - Blade Templating - How to properly Link to Route?

前端 未结 6 1529
我在风中等你
我在风中等你 2020-12-15 03:51

I want to create a resourceful link with Laravel. Normally I just use the {{ link_to_route(\'Yadayadayada.route\', \'LinkName\', $params }}

But in this

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-15 04:33

    If you Route use a Closure, you can use URL::to(), like this

    
        
         Dashboard 
    
    

    As @orrd sugested, in general terms is better to use named routes, so it can be easily change the URL later:

    
        
         Dashboard 
    
    

    (ref: https://laravel.com/docs/5.0/helpers#urls)

提交回复
热议问题