We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Get current link

Hello everyone! I want to get full path like this: http: //example.test/paymentlink/#/12345 But the path I received was cut after the "#" sign. How do I get full paths as above?



13.8k
edited Jan '18

From volt you can do this:

For Base Uri: {{ config.application.baseUri }}

For Rewrite Uri = {{ router.getRewriteUri() }}

Hope it helps!

You can use javascript

<script>
 location.toString(); // this will print current full url
</script>

I have found some phalcon code ,but I don't test it

echo $this->router->getRewriteUri();