PHPackages                             twelver313/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. twelver313/yii2-asset-converter

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

twelver313/yii2-asset-converter
===============================

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

2.1.0(1y ago)05BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jan 13Pushed 1y agoCompare

[ Source](https://github.com/mansurhamidov14/yii2-asset-converter)[ Packagist](https://packagist.org/packages/twelver313/yii2-asset-converter)[ RSS](/packages/twelver313-yii2-asset-converter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

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": {
    "twelver313/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'=>'Twelver313\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'=> 'Twelver313\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' => 'Twelver313\AssetConverter\Sass',
                    'output' => 'css', // parsed output file type
                    'options' => [
                        'cachePath' => '@app/runtime/cache/sass-parser' // optional options
                    ],
                ],
                'scss' => [ // file extension to parse
                    'class' => 'Twelver313\AssetConverter\Sass',
                    'output' => 'css', // parsed output file type
                    'options' => [] // optional options
                ],
                'less' => [ // file extension to parse
                    'class' => 'Twelver313\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' => 'Twelver313\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

24

—

LowBetter than 32% of packages

Maintenance42

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 63.9% 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

Unknown

Total

1

Last Release

484d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/20ac65a1b49c1b82d0b15b151ce0180df434a1657d05d02f022defb026315475?d=identicon)[twelver313](/maintainers/twelver313)

---

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)")[![skotos](https://avatars.githubusercontent.com/u/1259908?v=4)](https://github.com/skotos "skotos (1 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)")[![mansurhamidov14](https://avatars.githubusercontent.com/u/34154535?v=4)](https://github.com/mansurhamidov14 "mansurhamidov14 (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)")

---

Tags

convertersassscsslessyii2yiiassetcompassphamlp

### Embed Badge

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

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

###  Alternatives

[nizsheanez/yii2-asset-converter

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

64167.5k6](/packages/nizsheanez-yii2-asset-converter)[scssphp/scssphp

scssphp is a compiler for SCSS written in PHP.

62827.7M220](/packages/scssphp-scssphp)[trentrichardson/cakephp-shrink

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

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

PHPackages © 2026

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