SkillAgentSearch skills...

Phphaml

A PHP implementation of the HAML specification.

Install / Use

/learn @connec/Phphaml
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

[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/)

View on GitHub
GitHub Stars9
CategoryProduct
Updated3y ago
Forks1

Languages

PHP

Security Score

55/100

Audited on Jan 28, 2023

No findings