Slim Framework Base URL

后端 未结 7 544
太阳男子
太阳男子 2020-12-16 23:34

I\'m new to Slim Framework. How to get the base URL like with the Codeigniter function base_url()?

Thanks

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-17 00:19

    The easiest way to get the base url is to append the request url and the request root url like below: $req = $app->request; $base_url = $req->getUrl()."".$req->getRootUri()."/";

提交回复
热议问题