Mohit saini
Mohit saini

Reputation: 1

how to use dynamic base url in component in cakephp 3

used below code for base url Configure::write('SITEURL',"http://".$_SERVER['HTTP_HOST'] . "/mysite url/");

but this is not the correct way to use dynamic base url in cakephp 3, so pls suggest any good answer

Upvotes: 0

Views: 221

Answers (1)

Alex Stallen
Alex Stallen

Reputation: 2252

use Cake\Routing\Router;

$baseurl = Router::url('/', true);

Upvotes: 1

Related Questions