How to Get the Current URL Inside @if Statement (Blade) in Laravel 4?

前端 未结 28 2572
眼角桃花
眼角桃花 2020-11-28 01:15

I am using Laravel 4. I would like to access the current URL inside an @if condition in a view using the Laravel\'s Blade templating engine but I don\'t know ho

28条回答
  •  失恋的感觉
    2020-11-28 01:32

    instead of using the URL::path() to check your current path location, you may want to consider the Route::currentRouteName() so just in case you update your path, you don't need to explore all your pages to update the path name again.

提交回复
热议问题