public function beforeAction($action) { $view = $this->getView(); switch ($action->id) { case 'preview': PreviewAsset::register($view); break; default: PrintAsset::register($view); } return parent::beforeAction($action); }
use app\assets\AppAsset; use app\assets\PrintAsset; /* use yii\bootstrap\Nav; use yii\bootstrap\NavBar; use yii\widgets\Breadcrumbs; use app\assets\PrintAsset; use app\models\Menu; */ /* @var $this \yii\web\View */ /* @var $content string */ // if (!\app\helpers\Linet3Helper::isConsole()) { //$base=yii\helpers\BaseUrl::base(); PrintAsset::register($this); AppAsset::register($this); //$logopath = $base."/site/download/" . Linet3Helper::getSetting('company.logo'); } else { //console $this->registerCssFile(Yii::$app->params['url'] . "/css/print.css"); //Yii::$app->basePath. $this->registerCssFile(Yii::$app->params['url'] . "/css/site.css"); if (\Yii::$app->language == 'he_il') { $this->registerCssFile(Yii::$app->params['url'] . "/css/print-rtl.css"); $this->registerCssFile(Yii::$app->params['url'] . "/css/site-rtl.css"); } } $this->beginPage(); ?> <!DOCTYPE html>