使用资产库正确定位资产文件 [英] Correctly locating asset file with asset library

查看:89
本文介绍了使用资产库正确定位资产文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用cms附带的pyrocms资产库,并且已经为我的资产建立了这样的设置.我正在尝试找出路径和命名空间,以使我可以通过文档正确访问bootstrap.css文件.

I'm using the asset library that comes with pyrocms for my cms and I have a set up like this for my assets. I am trying to figure out with the paths and namespacing how I can access the bootstrap.css file correctly with the documentation.

http://docs.pyrocms.com/2.1/manual/developers/工具/资产

我已经更新了asset.php配置文件,使其看起来像这样:

I have updated my asset.php configuration file to look like this:

$config['asset_paths'] = array(
    'core' => 'assets/',
    'globals' => 'assets/globals/'
);

这是我在模板页面中设置的行,用于尝试检索引导文件:

This is the line I have set up in my template page to try and retrieve the bootstrap file:

<?php Asset::css('globals::bootstrap/css/bootstrap.min.css'); ?>

这是我的文件目录:

/root
    /assets
        /globals
            /bootstrap
                /css
                    bootstrap.css

这是在说以下错误消息.

It is saying the following error message.

没有找到匹配的文件 资产/globals/css/bootstrap/css/bootstrap.min.css

Found no files matching assets/globals/css/bootstrap/css/bootstrap.min.css

对此有什么好的解决办法吗?

Any ideas on what I good fix would be for this?

推荐答案

我从未使用过相关的库,但是从您的帖子来看,该库似乎自动检查了指定asset_path中的css文件夹.

I've never used the library in question, but judging on your post it appears that the library automatically checks for a css folder within the designated asset_path.

我将创建一个名为bootstrap的新资产路径:

I would create a new asset path called bootstrap:

'bootstrap' => 'assets/globals/bootstrap/'

并添加CSS文件,如下所示:

and add the CSS file as such:

Asset::css('bootstrap::bootstrap.min.css');

这篇关于使用资产库正确定位资产文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆