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.

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

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改