Posted By

sveggiani on 02/20/09


Tagged

cakephp


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

rudyjunior
jpsirois
TioSolid
hmvrulz


get current URL in cakephp


 / Published in: PHP
 

  1. echo $this->here;

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: jpsirois on July 21, 2009

Cakephp, always simple that no one need documentation to read your code =)

This object if another great proof of that ;)

Posted By: treemonster19 on December 7, 2009

nice work dude... i wonder if you can post any function that can print out url parameters like current controller and action ...i found one such but they work inside controller or components only i need that can be invoked under helpers or any scripts

Posted By: nina85 on December 30, 2010

Thanks a lot, I've searched for this everywhere. Cakephp's simply the best!

Posted By: userbiasa on February 25, 2011

thanks, very useful..

Posted By: javis on March 28, 2012

This is wrong.

Your solution won't return the current URL. It'll only give you the "controller/action" path.

To get the Current URL you should use:

or,

You need to login to post a comment.