Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
/ phphaml Public archive

A PHP implementation of the HAML specification.

Notifications You must be signed in to change notification settings

connec/phphaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[PhpHaml]

PhpHaml is a PHP library for working with HAML (and eventually SASS).

	<?php
	
	require 'library.php';
	
	phphaml\Library::autoload();
	
	$parser = new phphaml\haml\Parser("%hello world");
	echo $parser->render(); // <hello>world</hello>
	
	?>

[Library Structure]

The library was designed to be highly modular, there are 3 types of
component involved in parsing a document:

  - Parsers:
    Parsers are the most general component.  All they do, really, is traverse
    the source line-by-line, handle context switching (indentation) and then
    delegate the line to the appropriate Handler.
  
  - Handlers:
    Handlers perform the majority of the parsing.  They extract information from
    the source line and generate and manipulate the AST.  As much processing as
    possible should be done in the handlers to minimise the processing that
    needs done by the AST.
  
  - Nodes:
    Unsurprisingly, Nodes are used as nodes in the abstract syntax tree.  They
    contain all the information parsed by the Handlers, perform any context-
    sensitive validation and generate cacheable PHP code.

REQUIRES PHP >= 5.3

WTFPL (http://sam.zoy.org/wtfpl/)

About

A PHP implementation of the HAML specification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages