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

how to get current url and parameters

Hi

    /balabla/search?c=12&t=something&k=another&so_on..

how can I get the whole url with its parameters in that page to pass it and have something like this

    <a href="/login/index?path=/balabla/search?c=12&t=something&k=another&so_on.."> Login </a>


11.1k

https://docs.phalcon.io/en/latest/reference/url.html

in view you can get url by volt syntax

<a href="{{url()}}/index?path=/balabla/search?c=12&t=something&k=another&so_on.."> Login </a>


8.4k

thanks. the thing is, Im not using VOLT and I think it has to be something equivalent to $_SERVER["REQUEST_URI"] also How can I check whether the URI routing is valid and exists too.!?

https://docs.phalcon.io/en/latest/reference/url.html

in view you can get url by volt syntax

<a href="{{url()}}/index?path=/balabla/search?c=12&t=something&k=another&so_on.."> Login </a>


11.1k

Ok I was wrong. now I understand your question , sorry for my bad english. Did you use mod rewrite in your web app ? if you use you can pass parameter to your controller like /webpath/controller/action/param1/param2/param3/param4/param5 but i think you should to use ajax to send data with array may be better