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 full path URL

Hi :) I'm new to community nad have my hands on phalcon a week or so.

I need assistance because i can ot find a way to get full path url (add it in an email message) such as : "https://phalcon.mydomain.com/auth/confirmRegistration" the most i could get is "/auth/confirmRegistration" using $this->url->getStatic('auth/confirmRegistration')

there might be a build in function but i could not discover it, or maybe i should put the 'https://phalcon.mydomain.com' part in a global variable ??

thank you in advance



98.9k
Accepted
answer

Yes, set it on your url service:

$url->setBaseUri('https://phalcon.mydomain.com');


7.9k

thank you for your reply :)

actually i solved it like this : public/index.php define('BASE_URL', 'https://phalcon.mydomain.com');

because in url servive i set $url->setBaseUri('/'); an it works fine (so far)

since there are more than one options, do you suggest one of them for a particular reason or it is up to me ?

a side note : i try to restructure the authentication process because vokuro does not fit my needs in order to create a vanilla project for future use do you think that i should post here or in stcackoverflow whenever i have to address the community for assistance or advise ?