如何使用 hmvc codeigniter 在移动设备上加载 bootstrap?

How to load bootstrap on mbile using hmvc codeigniter?

我正在使用 PHP codeigniter(HMVC) bootstrap 等制作一个用于保存记录的桌面应用程序,我正在使用 xampp 在本地托管它,每当我从我的手机使用我电脑的 ip 地址,页面以普通 html 呈现 我在代码中使用了 bootstrap 它在我的电脑上运行良好,但是导航栏等 bootstrap 组件以普通呈现html.I 我正在使用 hmvc,因此我为页面布局制作了一个单独的文件夹。

我正在使用最新版本的 bootstrap,codeigniter(HMVC)

我知道这里有什么问题,您正在使用资产的相对路径,您不应该这样做..您需要使用完整的 uri,因为从另一个 ip 地址访问它会看到 localhost 和将其单独解析 localhost,希望你明白了,你需要做的是:

<link href="<?= site_url('path_to_bootstrap_css_relative_to_your_fcpath') ?>" rel="stylesheet" type="text/css">

并确保在 config.php

中设置 site_url