How to Get current URL in CakePHP?

Answer

To get current url in cakephp use, 
 
echo Router::url($this->here, true);
 
This will give full URL with hostname.If you want to get relative path instead of full URL,then use the following code:
echo $this->here;
 
This will produce absolute URL excluding hostname i.e. /controller/abc/xyz/

All cakephp Questions

Ask your interview questions on cakephp

Write Your comment or Questions if you want the answers on cakephp from cakephp Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---