Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    carrpirates
    @carrpirates
    Hi, i really love your package but i have several problem.
    In some case i need to load assets but except autoload and some other assets.
    Lets say in default layout i will load all the autoloaded assets but in the ajax layout i will only need to load added assets without the autoloaded.
    Can i load assets like that ?
    Javi
    @Stolz
    @carrpirates yes you can. In your AJAX controller you can call Assets::reset() and all the autoloaded (or any other loaded) assets will be reset. If you need to reset only CSS assets you can call Assets::resetCss() and if you need to reset only JS you can call Assets::resetJs()
    carrpirates
    @carrpirates
    My master layout depend on the request, so my master layout taking control which master layout should be used. I don't have ajax controller. All controller can serve both ajax and http request.
    I think i need some method like Assets::js(['autoload' => false]) since autoload is not collection and sometimes its not necessary to load them.
    Javi
    @Stolz
    Then I think your best option is not to use autoload at all. Save all assets that are currently in the autoload as a collection and use that collection when needed
    Ninja
    @ninjaparade
    anyone here for a quick question?
    using this package for the first time and I am wondering if there is a way to"order" the assets being outputted when adding ?
    IE add a JS file but require another JS file be added first?
    Javi
    @Stolz
    @ninjaparade I-m afraid there is no way to choose the order the assets are outputted. Assets are always loaded in the same order the where added. For collections the are loaded in the same order they are defined.
    So if you want to require a JS file (A) before loading another file (B), you could create a collection including the dependency file first (A) and the dependant file then (B) and just load the collection
    Ninja
    @ninjaparade
    This message was deleted
    @Stolz that's actually not what I was trying to do, let me explain a little better.
    I have a master layout, that I have a core group of assets that are needed for my app, and then on PER page load, some pages (sections) require more assets, scripts etc.
    so when I try to append to that collection that my master layout is using, the newly added script comes before the collection I created
    Javi
    @Stolz
    @ninjaparade It is tecnically imposible to add an asset before another. Take a look at the code and see how assets are ultimately added:
    $this->css[] = $asset;
    $this->js[] = $asset;
    So what I think is happening is that your routed code is not been actually executed in the order you think it is. This can easily happen if you load your assets using layout managers (such Laravel Blade), middlewares or view composers . You need to fully understand the life cycle of a request in your framework/app to debug what is that happening.
    Alex Weissman
    @alexweissman
    hey, anyone around?
    Javi
    @Stolz
    @alexweissman just ask whatever you want ;)
    Alex Weissman
    @alexweissman
    alright so, I'm trying to make a decision about how I want to implement asset management in my project, https://github.com/userfrosting/UserFrosting
    I've been using a homegrown PHP-based asset manager, but it is pretty limited
    and lately I've been checking out npm and Gulp, but there are a couple missing features (like stream wrappers) that I'm getting hung up on
    Javi
    @Stolz
    If you are looking for a feature-rich assets library I'm afraid Stolz/Assets is not for you. The goal of the library is to be as simple and easy to use as possible. For instance, It lacks assets compilation or assets preprocessing features.
    Alex Weissman
    @alexweissman
    oh! are you familiar with Grav?
    apparently their asset manager is adapted from Stolz/Assets
    Javi
    @Stolz
    I'm not familiar with Grav but I'm glad they found my work useful ;)
    Alex Weissman
    @alexweissman
    whaaaat? Yeah dude, they're growing fast and have a really well-designed and -documented CMS. https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Assets.php#L20
    Sujit mourya
    @sujitrulz
    hey, i want to ask, Can we upload the aggregated version to AWS S3 directly?
    chalamministries
    @chalamministries
    using font-awesome, it wants woff files. Can we load those too?
    Javi
    @Stolz
    @chalamministries , as far as I know you can't load woff files directly in your HTML. They are meant to be loaded from within a css file via @font-face. That means that even if you use the assets library to load them directly in your HTML it won't work.
    If FontAwesome is already using @font-face and you are using the pipelone, you may need to update the path of the font in the original CSS files
    Marwan Khanfar
    @marwankhanfar_twitter
    @Stolz does the package provide asset dependency feature
    ?
    Javi
    @Stolz
    @marwankhanfar_twitter yes it does, sort of. If any of the assets you add matches the name of a collection, all the assets of that collection will be added. If any of the assets of that collection happens to match the name of another collection, then all assets on that second collection will be loaded, and so on and so forth
    so by referencing collections you can load dependent nested collections
    You have an example of this behavior in the readme file https://github.com/Stolz/Assets#sample-collections ,where both Bootstrap and Fundation depend on jQuery
    Bhasker Thapa
    @bk9999
    hi
    i am getting this error: Class 'Assets' not found
    Please help
    Javi
    @Stolz
    @bk9999 Are you using Laravel or not?. 'Assets' is the name of the Laravel facade. If you are not using Laravel you need to use the full class name which is 'Stolz\Assets\Manager'
    Anddi Rohandi
    @andirohandi_gitlab

    hallo,

    i have a problem with this package, how to give version on js and css file ?
    thanks

    Javi
    @Stolz
    @andirohandi_gitlab To specify a version you must set the pipeline option value to the value of your version, for instance 'pipeline' => '1.0'. If you set 'pipeline' => 'auto' the version will be automatically calculated based on your assets last modification time.
    Maicol
    @maicol07
    Hi, is this project still mantained?