PHPackages                             alexluke/grunt-haml-php - 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. [Templating &amp; Views](/categories/templating)
4. /
5. alexluke/grunt-haml-php

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

alexluke/grunt-haml-php
=======================

Process HAML templates using MtHaml, a PHP port of Haml.

0.1.0(12y ago)9238[7 issues](https://github.com/alexluke/grunt-haml-php/issues)[2 PRs](https://github.com/alexluke/grunt-haml-php/pulls)MITJavaScript

Since Nov 14Pushed 10y ago1 watchersCompare

[ Source](https://github.com/alexluke/grunt-haml-php)[ Packagist](https://packagist.org/packages/alexluke/grunt-haml-php)[ Docs](https://github.com/alexluke/grunt-haml-php)[ RSS](/packages/alexluke-grunt-haml-php/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

grunt-haml-php
==============

[](#grunt-haml-php)

> Process HAML templates using MtHaml, a PHP port of Haml.

Getting Started
---------------

[](#getting-started)

This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```
npm install grunt-haml-php --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```
grunt.loadNpmTasks('grunt-haml-php');
```

The "haml" task
---------------

[](#the-haml-task)

This plugin requires [composer](http://getcomposer.org/) in order to install PHP dependencies. Please follow the [installation instructions](http://getcomposer.org/doc/00-intro.md#system-requirements) before installing this plugin.

### Overview

[](#overview)

In your project's Gruntfile, add a section named `haml` to the data object passed into `grunt.initConfig()`.

```
grunt.initConfig({
  haml: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})
```

### Options

[](#options)

#### options.target

[](#optionstarget)

Type: `String`Default value: `php`

Set the target output generated by MtHaml. Valid options are `php` and `twig`.

#### options.writeError

[](#optionswriteerror)

Type: `Boolean`Default value: `true`

If enabled, write any compile errors to the output file. Otherwise do nothing.

#### options.enableDynamicAttributes

[](#optionsenabledynamicattributes)

Type: `Boolean`Default value: `true`

Controls the `enable_dynamic_attrs` option of MtHaml. Disabling this removes the requirement for the MtHaml runtime.

### Usage Examples

[](#usage-examples)

#### Simple file mapping

[](#simple-file-mapping)

```
grunt.initConfig({
  haml: {
    compile: {
      files: {
        'dest/file1.html': ['src/file1.haml'],
      },
    },
  },
})
```

#### All haml files

[](#all-haml-files)

This example compiles all haml files in a directory and adds a php extension.

```
grunt.initConfig({
  haml: {
    compile: {
      files: [{
        expand: true,
        src: ['src/templates/**/*.haml'],
        dest: 'dest/templates',
        ext: '.php'
      }],
    },
  },
})
```

Contributing
------------

[](#contributing)

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

Release History
---------------

[](#release-history)

- 12/9/2013 - v0.2.1 - Catch all php errors, regardless of system settings
- 11/20/2013 - v0.2.0 - Add option for writing errors to output file
- 11/14/2013 - v0.1.0 - Initial release.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance4

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

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

4562d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5932cefad017be226a3d02eecec1b823d041b7a03b1dab76ffcc3ea5e75ca692?d=identicon)[alexluke](/maintainers/alexluke)

---

Top Contributors

[![alexluke](https://avatars.githubusercontent.com/u/168764?v=4)](https://github.com/alexluke "alexluke (9 commits)")[![esad](https://avatars.githubusercontent.com/u/11807?v=4)](https://github.com/esad "esad (2 commits)")[![konstantin24121](https://avatars.githubusercontent.com/u/9361325?v=4)](https://github.com/konstantin24121 "konstantin24121 (2 commits)")

---

Tags

phpHAMLgruntmthamlgruntplugin

### Embed Badge

![Health badge](/badges/alexluke-grunt-haml-php/health.svg)

```
[![Health](https://phpackages.com/badges/alexluke-grunt-haml-php/health.svg)](https://phpackages.com/packages/alexluke-grunt-haml-php)
```

###  Alternatives

[endroid/qr-code-bundle

Endroid QR Code Bundle

32110.6M17](/packages/endroid-qr-code-bundle)[trupedia/laravel-blade-haml

Wraps MtHaml for ease use in Laravel 5 with Blade syntax style

163.8k](/packages/trupedia-laravel-blade-haml)

PHPackages © 2026

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