How to get current URL in CakePHP ?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Feb 22, 2018

 

In Cakephp 2.x you can get current url in view by using $this->here; or Router::url( $this->here, true );

In Cakephp 3.x you can get current url in view by using $this->Url->build(null, true);

Also Read Best Core PHP Interview Questions

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Cakephp interview questions

    What is CakePHP ?

    CakePHP is an open-source free web framework written in PHP scripting Language for rapid web development...

    Cakephp interview questions

    What is MVC in CakePHP?

    MVC stands for the model view controller.MVC is not a design pattern, it is an architectural pattern that describes a way to structure our application and explains the responsibilities and interaction..

    Cakephp interview questions

    What are Hooks in CakePHP?

    CakePHP hooks are callback functions that are called before or after a model operation.We define these functions in our Model classes...