How to get current URL in CakePHP ?

devquora
devquora

Posted On: Apr 26, 2024

 

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...