How to get complete current url for Cakephp

前端 未结 24 1276
长情又很酷
长情又很酷 2020-12-08 00:10

How do you echo out current URL in Cake\'s view?

24条回答
  •  清歌不尽
    2020-12-08 00:44

    You can do either

    From a view file:

    request->here() ?>">
    

    Which will give you the absolute url from the hostname i.e. /controller/action/params

    Or

     
    

    which should give you the full url with the hostname.

提交回复
热议问题