Phalcon 4 - Router::getRewriteUri() is not working

Hi

why doesn't it work?

$router = new Phalcon\Mvc\Router();

var_dump($router->getRewriteUri());

PHP Fatal error: Uncaught Error: Call to undefined method Phalcon\Mvc\Router::getRewriteUri() in ...

php = 7.4

phalcon = 4.0.6

P.s. https://docs.phalcon.io/4.0/en/api/Phalcon_Mvc_Router (404 error)

4.0 routing documentation can be found here: https://docs.phalcon.io/4.0/en/routing and https://docs.phalcon.io/4.0/en/api/phalcon_mvc#mvc-router.

4.0 changed a few things from 3.4. It looks like getRewriteUri() was not a function that carried over. Hence the standard - "undefined method" error.

What are you trying to accomplish? There's likely another way...



1.3k

The client sent a ready-made project written in Phalcon 3, which I have to finish to the end. Following the instructions, I installed a Phalcon 4.

I looked at the project, this function is used in many places in the code. What can I replace this function with a different method?

Now I am trying to install Phalcon 3 and this turned out to be not an easy task for me.



1.3k

4.0 changed a few things from 3.4. It looks like getRewriteUri() was not a function that carried over. Hence the standard - "undefined method" error.

In the documentation doesn't mark the feature as Deprecated. :(