如何在 Cake 的视图中回显当前 URL?
How do you echo out current URL in Cake's view?
你可以做任何一个
来自视图文件:
<?php echo $this->request->here() ?>">
哪个会给你来自主机名的绝对网址,即/controller/action/params
Which will give you the absolute url from the hostname i.e. /controller/action/params
或
<?php echo Router::url(null, true) ?>
它应该为您提供带有主机名的完整网址.
which should give you the full url with the hostname.
这篇关于如何获取 Cakephp 的完整当前 url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!