Search code examples
phpcodeigniterpyrocms

Trying to load theme assets in pyrocms only using template and asset library


In trying to find out how to have the following work. I'm using the template and asset libraries from PyroCMS to help in aiding my CI application and I’m trying to figure out how I can have the dashboard look for the images/css/js files in the file structure below as opposed to the regular assets folder in the public_html folder since those files only pertain to that theme. As far as I know the code below is what is used to render a specific css file. The theme is running smoothly but when the line below gets called it renders nothing as if there is no code line present.

I'm still trying to find out why the line isn't getting rendered. I'm still needing an idea for this.

<?php echo Asset::css(‘bootstrap/bootstrap.min.css’); ?>

public_html/
    application/
        themes/
            supr/
                assets/
                    js/
                    images/
                    css/
                        bootstrap/bootstrap.min.css
                views/
                    layouts/
                        default.php

Solution

  • Asset::css() only adds the file you want to include into a list (array) of CSS files. You need to call Asset::render_css() to generate the actual <link> HTML.

    http://docs.pyrocms.com/2.1/manual/developers/tools/assets