Removed assets still loading.

I removed all assets from asset manager and all of registered assets from layout and views but they’re still loaded. How is it possible?

I cleared cache and cookies.

I found some of them are loaded by default like JQuery , bootstrap and so on. I’d loaded some assets like “yii\validators\ValidationAsset” for some reasons either. I did it with combining and compressing methods mentioned at yii document and everything was working fine. I’ve decided to disable all assets for a while but I can’t. However all of theme are loaded uncombined and decompressed.

How can I disable them?

How did you disable them?

This is sssssoooo last week :)

Take a look here…

http://www.yiiframework.com/forum/index.php/topic/68727-how-to-recompile-bootstrap-less-css-automatically/

I am using the advanced app and I have this in my common\config\main.php




        'assetManager' => [

            'bundles' => [

                'yii\bootstrap\BootstrapAsset' => FALSE,

                'yii\bootstrap\BootstrapPluginAsset' => FALSE,

                'yii\web\JqueryAsset' => FALSE,

            ],

            'appendTimestamp' => TRUE,

        ],



If you are using the basic template, just put it in your main config file. This will entirely stop Yii from actually publishing the assets.

Yes, it works. Thank you.

Sorry, it wasn’t even a question if I would take a good look at the documents. However I can’t figure out how my old asset bundles are still loaded? I mean those which are not default like ‘yii\validators\ValidationAsset’ .

"Location:Iran, Tehran"

Sobh bekhayr doostam. Man doost e irani daram (az Tehran) paz alan yekami Farsi baladam :)

Any that are still being loaded, just set them to FALSE in that config. There will be asset bundles being called in the classes themselves, which will still be published even if none of the asset files themselves are ever used in the site itself. Any time it happens, identify which asset it is and set them to FALSE in the config and that should take care of it.

As I mentioned in that thread above, I am currently using compiling all my CSS and JS into single files - for instance my CSS contains the default Yii site.css, bootstrap, scrolltotop and font-awesome all compiled into the single all.css file. That file (along with all.js) is currently being published though AppAsset. The reason I am still using AppAsset is that for development purposes I find it easier to just edit AppAsset to switch between .css and .min.css if need be. When the site does into production, I will be just adding the all.css and all.js by directly embedding in the layout file header itself. Keep thing minimal :)

If you need any other help, let me know and I will see if I can help you.

If you have Yii Debug running, check what - if any - assets are published. They are listed by name so that it is easy to disable them.

Shoma kheili khoob farsi baladi! mamnoon ke be man komak mikoni! :) :)

Your descriptions is very useful. I understood what’s happening eventually.

I’m using compiling all css and js into single file, too. I’m trying to find a way to make it easier for development purposes. Your manner is simple and make things easier. Definitely I’m going to consider it.

Thank you so much for helping me!

Be doostet ham salalm beresoon!

Thank you for your consideration.

I can disable them in the manner you mentioned but the question is why are they still being loaded?

U4EA described it a bit how it is happening. However I’m not sure if this is what has to be happened. Does it make sense? I’m still not so sure.

Happening such things makes me thing there are some black boxes in the application that act unpredictably. How can I trust an app has weird behaviors ?

I would be great if you were more specific :)

What packages exactly?

Yes, it might seem like black magic, initially - and it seemed that way to me for a long time - but some of the extensions/modules that your application is using loads assets that either publish themselves or depends on other modules/extensions assets.

It could well be that one package, even though you have disabled the asset publishing, depends on some other asset.

The best way to figure out what happens is to use the debugger and see where all those sneaky assets are coming from!

The debugger allows you to look inside those black boxes.

U4EA and I have successfully disabled the publishing of all assets, and so can you. :)

You exactly right and I understand it clearly now. Thanks.

Yii debugger is a perfect tool but I couldn’t use it to find the source of assets.

I’ve found it eventually and it was a Form in a Modal which published those assets.

The problem was I’d published exactly the same packages for some reasons a few days ago and I thought this was why they are still loaded. It was my great mistake!

The packages was ‘yii\validators\ValidationAsset’ , yii\widgets\ActiveFormAsset.

I appreciate all of you and sorry for bothering you.

The problem solved. :)

No need to be sorry - you were asking a question in an exemplary way :)

The biggest bugs are sitting between our own ears - it happens to me all the time - it’s just part of being a programmer / human being. :)

Debugger - Asset Bundles :

I meant widget or extension which publish those assets as I said “source”. Is there any way to track which extension is calling those assets using Yii debugger ? I’m still not very familiar with all debugger’s capabilities.

You can add this to your AppAssets.php:

public $publishOptions = [
‘forceCopy’ => true,

];

by adding this,evey change in assets will apear in your output at the moment.