Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # Symfony router:match
  2. rtm() {
  3. url=$1
  4.  
  5. # remove domain
  6. url=`echo $url | sed -r 's#.*//[^/]+##g'`
  7.  
  8. # add leading slash
  9. firstChar="${url:0:1}"
  10. [ ! $firstChar == "/" ] && url=/$url
  11.  
  12. match=$(script -q -c "core/symfony/app/backend/console router:match $url")
  13. if [[ $match = *'None of the routes match'* ]]
  14. then
  15. console router:match $url/
  16. else
  17. echo "$match"
  18. fi
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement