dmstr/yii2-pages-module

PHP parse error in the PagesAsset bundle

rochdi80tn opened this issue · 1 comments

PHP Parse Error – yii\base\ErrorException

syntax error, unexpected '.', expecting ',' or ';'
line 16

14: class PagesAsset extends AssetBundle
15: {
16:     public $sourcePath = __DIR__.'/less';
17:     public $css = [
18:         'module.less'
19:     ];
20: }

I've fixed this locally by addint init() function as bellow and removing the initialization of the public $sourcePath :

class PagesAsset extends AssetBundle
{
    public $sourcePath ;
    public $css = [
        'module.less'
    ];

    public function init() {
        parent::init();
        $this->sourcePath = __DIR__.'/less';
    }

}

I am using below PHP version and not sure whether this is related to this or not

PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul 2 2015 15:23:08)

Thanks.

Looks like you don't have __DIR__ set.
Would @vendor/dmstr/modules/pages/assets/less work?