Slim Framework基本URL [英] Slim Framework Base URL
本文介绍了Slim Framework基本URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Slim Framework的新手.如何像使用Codeigniter函数base_url()
一样获得基本URL?
I'm new to Slim Framework. How to get the base URL like with the Codeigniter function base_url()
?
谢谢
推荐答案
您需要先手动设置基本url,然后才能获取它 像这样:
You need to set the base url manually FIRST before you can get it as in this:
$app->hook('slim.before', function () use ($app) {
$app->view()->appendData(array('baseUrl' => '/base/url/here'));
});
http://help.slimframework .com/discussions/questions/49如何处理基本路径和不同的路线
这篇关于Slim Framework基本URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文