Ich habe RTL-Layout für meine yii2 Anwendung mit airani\bootstrap\BootstrapRtlAsset
. Allerdings möchte ich den Bootstrap mit this online tool anpassen.Gibt es einfachere Art und Weise Abhängigkeit in Yii2 Werts gesetzt
Das Tool erzeugt eine css Datei, die ich möchte, dass es direkt verknüpft wird, bevor bootstrap-rtl.css
von BootstrapRtlAsset kommt.
Der einzige Weg, dass ich weiß, das zu tun, ist neu AssetBundle in app/Assets wie die Erstellung von folgenden:
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'app\assets\ThemeAsset',
'airani\bootstrap\BootstrapRtlAsset',
];
:
<?php
namespace app\assets;
use yii\web\AssetBundle;
class ThemeAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/theme.min.css',
];
public $js = [
];
}
Dann sollte ich es in der $depends
von AppAsset
hinzufügen
So gibt es eine andere Art und Weise, die mir app\assets\ThemeAsset
nur mit dem Pfad der CSS-Datei css/theme.min.css
ohne Notwendigkeit zu ersetzen, ermöglicht neue AssetBundle erstellen?
Sie haben Recht. Es sollte aus dem Layout verwendet werden, wenn ich es will auf alle Ansichten angewandt werden, wie folgt: '$ this-> registerCssFile ('/ css/theme.min.css' [ 'hängt' =>‚yii \ Bootstrap \ BootstrapAsset ']); 'wo wir die' abhängige' Option als BootstrapAsset festlegen, so kommt es danach und vor BootstrapRtlAsset. – SaidbakR
@ sємsєм: Genau .. Du hast es ... Viel Spaß :) –