S
S
Svetlana Galenko2019-12-04 16:32:31
css
Svetlana Galenko, 2019-12-04 16:32:31

How to add id or class to styles in yii2?

How to add an identifier or a class to the styles in AppAsset.php in yii2 so that it is displayed in the browser like this:

<link id="theme_css" rel="stylesheet" href="assets/css/light.css">
    <link id="skin_css" rel="stylesheet" href="assets/css/skins/default.css">

Not like this:
<link rel="stylesheet" href="assets/css/light.css">
    <link rel="stylesheet" href="assets/css/skins/default.css">

AppAsset.php:
public $css = [
        'assets/css/light.css',
        'assets/css/skins/default.css',
    ];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Svetlana Galenko, 2019-12-04
@swallow_97

The question is closed, I tried to write like this:

public $css = [
        ['assets/css/light.css', 'id' => 'theme_css'],
    ];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question