G
G
Greg Popov2016-02-18 22:34:08
css
Greg Popov, 2016-02-18 22:34:08

How to connect in advanced Yii2 from vendor files?

In basic it turned out to connect like this:

namespace app\assets;
use yii\web\AssetBundle;


class FoundationAsset extends AssetBundle
{
    public $sourcePath = '@vendor/bower/foundation/';
    public $js       = [
        'js/foundation.min.js'
    ];
}

advanced does not see files. Where is the mistake?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
3
333Serega333 333Serega333, 2016-02-18
@333Serega333

Check if @vendor alias is declared

D
Dmitry Voronkov, 2016-02-19
@DmitryVoronkov

Did Composer install those files correctly? do they exist physically? I'm about

public $sourcePath = '@vendor/bower/foundation/';
    public $js       = [
        'js/foundation.min.js'
    ];

Try like this:
<?php
namespace app\assets;

use yii\web\AssetBundle;

class BootstrapAsset extends AssetBundle
{
 public $sourcePath = '@bower/foundation';
    public $js       = [
        'js/foundation.min.js'
    ];
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question