D
D
Dmitry Kulikov2015-11-23 12:01:39
Yii
Dmitry Kulikov, 2015-11-23 12:01:39

How to change resources correctly in yii2?

I publish js, css and pictures through Asset, Since the resources are initially inaccessible from the web, they themselves are published in .../web/assets/ But I ran into the following problem. how to overwrite published files? as I understand it, yii does not compare the published file and the current one each time, and when changes are made, they do not occur.
In order for the files to be updated, now I delete the folder with the necessary files from .../web/assets/ , is there an easier way to update resources?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Khomenko, 2015-11-23
@dmitryi_k

You can go the other way and not copy the assets, but put links to them

'components' => [

        // ...

        'assetManager' => [
            'linkAssets' => true,
            'appendTimestamp' => true,
        ],

In this case, the current versions of the assets will always be connected.

A
Alexander, 2015-11-23
@p0vidl0

public $publishOptions = [
    'forceCopy' => YII_DEBUG,
];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question