S
S
sergeysd2016-08-21 10:32:45
Yii
sergeysd, 2016-08-21 10:32:45

How to add a hash to a style or script in Yii2?

Hey!
There was a need for a script (or style) through ? add a dynamically generated hash.
In the assets.php file, the style is written as an array element and you cannot insert a php function there.
How it's done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-08-22
@slo_nik

Good afternoon.
In the configuration file, add to the components section

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question