這是我的索引文件:<?phprequire_once 'lib/limonade.php';echo $root_dir;option('base_path',? ? ? ? ? $base_path);option('base_uri',? ? ? ? ? ?$base_uri);option('root_dir',? ? $root_dir);option('public_dir',? $root_dir.'/public/');我的 default_layout.php 文件引用 css 文件,如下所示:<link rel="stylesheet" href="public/css/bootstrap.css">我的 .htacces 文件也如下所示:<IfModule mod_rewrite.c>? Options +FollowSymlinks? Options +Indexes? RewriteEngine on? # if your app is in a subfolder? # RewriteBase /my_app/? # test string is a valid files? RewriteCond %{SCRIPT_FILENAME} !-f? # test string is a valid directory? RewriteCond %{SCRIPT_FILENAME} !-d? RewriteRule ^(.*)$? ?index.php?uri=/$1? ? [NC,L,QSA]? # with QSA flag (query string append),? # forces the rewrite engine to append a query string part of the? # substitution string to the existing string, instead of replacing it.</IfModule>有誰知道這種小項目的類似且更好的微框架,我只需要使用 api 或知道如何解決這個問題。
1 回答

千巷貓影
TA貢獻1829條經驗 獲得超7個贊
像下面這樣使用它
<link rel="stylesheet" href="/public/css/bootstrap.css">
然后它將開始從根文件夾搜索
- 1 回答
- 0 關注
- 168 瀏覽
添加回答
舉報
0/150
提交
取消