duanjia4220 2014-12-01 13:47
浏览 30

如何覆盖锂li3中的物理资产路径

I'd like to override the paths lithium uses to retrieve assets but am not sure how to do that.

Using the Media::assets method doesn't seem to have any affect accept that it changes the Url that the Html::script helper uses.

How do I appropriately override the real path that lithium uses for assets? Below is an example of how I tried to override the asset paths for javascript files:

Media::assets('js', array(
    'suffix' => '.js',
    'filter' => null,
    'theme' => 'blue',
    'paths' => array(
        '{:base}/{:library}/themes/{:theme}/public/js/{:path}' => array('base', 'library', 'theme', 'path'),
        '{:base}/{:library}/themes/default/public/js/{:path}' => array('base', 'library', 'path')
    )
));
  • 写回答

1条回答 默认 最新

  • dongyu2764 2015-05-07 08:47
    关注

    Can you elaborate more about what you mean by retrieving assets and real path?

    Media::assets function does exactly what it is expected from it, to set the paths used by Media::asset() which is currently used by the default path handler in lithium\template\view\Renderer. The problem is that the default path handler does not seem to pass a library option, so my guess is the {:library} token will always be replaced with the basename of your default library path.

    I don't see why you would need to fiddle with the default paths though. Plus you can always use absolute path by adding / prefix when you use Html::script function.

    评论

报告相同问题?

悬赏问题

  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码