Kevin Smith
Kevin Smith

Reputation: 731

Correctly locating asset file with asset library

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/tools/assets

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'); ?>

This is my file directory:

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

It is saying the following error message.

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

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

Upvotes: 1

Views: 233

Answers (1)

Jeemusu
Jeemusu

Reputation: 10533

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.

I would create a new asset path called bootstrap:

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

and add the CSS file as such:

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

Upvotes: 2

Related Questions