Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i get base url in OctoberCMS?

Tags:

octobercms

I want to show image in backend render list. For that how to get the path to show image. We have tried base_path() method.

But it gives me full path like "opt/lampp/htdocs/ashish/" but i want to get http://localhost/ashish

like image 520
Ashish Detroja Avatar asked Jun 15 '16 12:06

Ashish Detroja


2 Answers

Please use Request::getBaseUrl() for get base path like http://localhost/ashish

like image 119
Ashish Detroja Avatar answered Sep 28 '22 02:09

Ashish Detroja


In twig you can do:

{{ url('/') }}
like image 42
Will Avatar answered Sep 28 '22 03:09

Will