PHPackages                             nizsheanez/yii2-asset-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nizsheanez/yii2-asset-converter

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

nizsheanez/yii2-asset-converter
===============================

Less, Sass, Scss and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

v2.0.1(6y ago)61170.8k↓41.8%436BSD-3-ClausePHPPHP &gt;=5.4.0

Since Sep 14Pushed 6y ago8 watchersCompare

[ Source](https://github.com/nizsheanez/yii2-asset-converter)[ Packagist](https://packagist.org/packages/nizsheanez/yii2-asset-converter)[ RSS](/packages/nizsheanez-yii2-asset-converter/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (6)Versions (25)Used By (6)

Only for YII2 with the new Asset Manager, convert Less and Sass files to CSS whithout external tools and executable. The sass and less files are converted with PHP libraries It replace the AssetConverter who use external tools. The Less and Sass file are converted with time source files dependency.

\###Requirements

YII 2.0

\###Usage

1. Install with Composer

```
"require": {
    "nizsheanez/yii2-asset-converter": "1.*",
},

php composer.phar update
```

2. Modify assetManager in your configuration file {app}/protected/config/main.php

```
    'assetManager' => [
        'bundles' => require(__DIR__ . '/assets.php'),
        'converter'=> [
            'class'=>'nizsheanez\assetConverter\Converter',
        ]
    ],
```

3. Create .gitignore in
4. Enjoy!

- Files with extension .sass are converted to a .css file
- Files with extension .less are converted to a .css file
- Files with extension .scss are converted to a .css file

\###Example of assets config file /protected/config/assets.php

```
return [
	'app' => [
		'basePath' => '@webroot',
		'baseUrl' => '@web',
        'css' => [
			'css/bootstrap.min.css',
			'css/bootstrap-responsive.min.css',
			'css/site.css',
            'css/less_style.less',
            'css/sass_style.sass',
		],
		'js' => [

		],
		'depends' => [
			'yii',
		],
	],
];
```

\###Where is compiled files?

By default it present at @webroot/compiled But you can change it by destinationDir property from config

### Full configuration

[](#full-configuration)

```
'components' => [
	'assetManager' => [
        'converter'=> [
            'class'=> 'nizsheanez\assetConverter\Converter',
            'force'=> false, // true : If you want convert your sass each time without time dependency
            'destinationDir' => 'compiled', //at which folder of @webroot put compiled files
            'parsers' => [
                'sass' => [ // file extension to parse
                    'class' => 'nizsheanez\assetConverter\Sass',
                    'output' => 'css', // parsed output file type
                    'options' => [
                        'cachePath' => '@app/runtime/cache/sass-parser' // optional options
                    ],
                ],
                'scss' => [ // file extension to parse
                    'class' => 'nizsheanez\assetConverter\Sass',
                    'output' => 'css', // parsed output file type
                    'options' => [] // optional options
                ],
                'less' => [ // file extension to parse
                    'class' => 'nizsheanez\assetConverter\Less',
                    'output' => 'css', // parsed output file type
                    'options' => [
		    	'importDirs' => [], // import paths, you may use path alias here ex. '@app/assets/common/less'
                        'auto' => true, // optional options
                    ]
                ]
            ]
        ]
    ],
],
```

Also, for SCSS files you can use alternate configuration:

```
'components' => [
    'assetManager' => [
            'converter'=> [
                // ...
                'parsers' => [
                    // ...
                    'scss' => [ // file extension to parse
                        'class' => 'nizsheanez\assetConverter\Scss',
                        'output' => 'css', // parsed output file type
                        'options' => [ // optional options
                            'enableCompass' => true, // default is true
                            'importPaths' => [], // import paths, you may use path alias here,
                                // e.g., `['@path/to/dir', '@path/to/dir1', ...]`
                            'lineComments' => false, // if true — compiler will place line numbers in your compiled output
                            'outputStyle' => 'nested', // May be `compressed`, `crunched`, `expanded` or `nested`,
                                // see more at http://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style
                        ],
                    ],
                ],
            ],
        ],
    // ...
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 64.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~105 days

Recently: every ~397 days

Total

24

Last Release

2249d ago

Major Versions

v1.5.0 → v2.0.02020-04-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/686798?v=4)[Alex Sharov](/maintainers/nizsheanez)[@nizsheanez](https://github.com/nizsheanez)

---

Top Contributors

[![nizsheanez](https://avatars.githubusercontent.com/u/686798?v=4)](https://github.com/nizsheanez "nizsheanez (69 commits)")[![mervick](https://avatars.githubusercontent.com/u/2429298?v=4)](https://github.com/mervick "mervick (12 commits)")[![athos99](https://avatars.githubusercontent.com/u/208224?v=4)](https://github.com/athos99 "athos99 (8 commits)")[![Blizzke](https://avatars.githubusercontent.com/u/231572?v=4)](https://github.com/Blizzke "Blizzke (3 commits)")[![petrovich24](https://avatars.githubusercontent.com/u/20962964?v=4)](https://github.com/petrovich24 "petrovich24 (2 commits)")[![susgo](https://avatars.githubusercontent.com/u/20994932?v=4)](https://github.com/susgo "susgo (2 commits)")[![mlaxwong](https://avatars.githubusercontent.com/u/11769661?v=4)](https://github.com/mlaxwong "mlaxwong (2 commits)")[![uniqby](https://avatars.githubusercontent.com/u/1488394?v=4)](https://github.com/uniqby "uniqby (1 commits)")[![AskAlexSharov](https://avatars.githubusercontent.com/u/46885206?v=4)](https://github.com/AskAlexSharov "AskAlexSharov (1 commits)")[![vuquangthinh](https://avatars.githubusercontent.com/u/1710072?v=4)](https://github.com/vuquangthinh "vuquangthinh (1 commits)")[![cyberinferno](https://avatars.githubusercontent.com/u/1510205?v=4)](https://github.com/cyberinferno "cyberinferno (1 commits)")[![dima-gusyatiner](https://avatars.githubusercontent.com/u/6461669?v=4)](https://github.com/dima-gusyatiner "dima-gusyatiner (1 commits)")[![firstrow](https://avatars.githubusercontent.com/u/66944?v=4)](https://github.com/firstrow "firstrow (1 commits)")[![philippfrenzel](https://avatars.githubusercontent.com/u/2319890?v=4)](https://github.com/philippfrenzel "philippfrenzel (1 commits)")[![RdeWilde](https://avatars.githubusercontent.com/u/184016?v=4)](https://github.com/RdeWilde "RdeWilde (1 commits)")[![skotos](https://avatars.githubusercontent.com/u/1259908?v=4)](https://github.com/skotos "skotos (1 commits)")

---

Tags

convertersassscsslessyii2yiiassetcompassphamlp

### Embed Badge

![Health badge](/badges/nizsheanez-yii2-asset-converter/health.svg)

```
[![Health](https://phpackages.com/badges/nizsheanez-yii2-asset-converter/health.svg)](https://phpackages.com/packages/nizsheanez-yii2-asset-converter)
```

###  Alternatives

[scssphp/scssphp

scssphp is a compiler for SCSS written in PHP.

62930.2M319](/packages/scssphp-scssphp)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)[wapplersystems/ws-scss

Compiles SCSS to CSS at runtime with caching, TypoScript variables and EXT: import support

11149.9k8](/packages/wapplersystems-ws-scss)[trentrichardson/cakephp-shrink

Compiles, combines, and minifies javascript, coffee, less, scss, and css

1619.4k](/packages/trentrichardson-cakephp-shrink)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
