Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cakephp find hostname from url in cakephp

Tags:

cakephp-2.0

I need to find host from referrer URL in CakePHP. I can do same in core php with parse_url function. I have tried Router::parse function but it gives me output in from of array of controller, action.

like image 297
priyanka Avatar asked May 19 '26 00:05

priyanka


1 Answers

If you're within a controller, $this->request->host() will return the host directly.

like image 147
Ope Adeyomoye Avatar answered May 23 '26 15:05

Ope Adeyomoye



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!