duanhai7274 2013-07-23 18:01
浏览 53
已采纳

将模块名称添加到模板URL

I am using modules within my codeigniter application and PHil Sturgeon's template library and I'm trying to understand my this is happening when I view the source code of my template. Its adding on the string user which is the name of the module.

http://mysite.me/index.php/user/assets/globals/bootstrap/css/bootstrap.min.css

<!--[if gt IE 8]><!--> <html> <!--<![endif]-->

<head>
    <title><?php echo $template['title']; ?></title>

    <!-- Meta -->
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />

    <!-- Bootstrap -->
    <link href="<?php base_url() ?>assets/globals/bootstrap/css/bootstrap.min.css" rel="stylesheet" />


-application
    -themes
        -mytheme
            -views
                -layouts
                    usermanagement_view.php
  • 写回答

1条回答 默认 最新

  • douze2890241475 2013-07-23 18:04
    关注

    You're not echoing the base_url(), i.e. not printing it on the page...It should be:

    <link href="<?php echo base_url() ?>assets/globals/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    

    Without it, the href attribute gets appended to the segments in the url, that's why you get that result.

    Maybe you meant to use the short tag <?= , which stands for <?php echo. In this case, just don't - they're not always enabled in php.ini, and the 2 chars you spare can be a big hassle when deploying live.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?