Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Yet another Haml to HTML converter written in PHP.
PHP JavaScript Perl
branch: master

This branch is 1 commit ahead, 25 commits behind hamlphp:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
src/HamlPHP
test
.gitignore
MIT-LICENSE
README.mkd

README.mkd

HamlPHP

Yet another Haml to HTML converter written in PHP.

NOTE: The ownership of this repository has been moved to https://github.com/hamlphp/HamlPHP.

Requirements

PHP 5.2 or newer.

Usage

index.haml

!!! 5
%html
    %body
        #container
            %ul.navigation
                %li Etusivu
                %li Tuotteet

            %h2 Tuotteet
            %ul.products 
                %li= 1 * 6
                - for ($i = 0; $i < 10; $i++)
                    %li= $i + 3

In your index.php

<?php

require_once 'src/HamlPHP/HamlPHP.php';
require_once 'src/HamlPHP/Storage/FileStorage.php';

// Make sure that a directory _tmp_ exists in your application and it is writable.
$parser = new HamlPHP(new FileStorage(dirname(__FILE__) . '/tmp/'));

$content = $parser->parseFile('index.haml');

echo $content;
Something went wrong with that request. Please try again.