10.02.2013 Views

PHP Programming Language - Cultural View

PHP Programming Language - Cultural View

PHP Programming Language - Cultural View

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

pHAML 187<br />

pHAML<br />

Developer(s) David Moring<br />

Stable release 0.9 (preview release) / August 4, 2007<br />

Operating<br />

system<br />

Cross-platform<br />

Type Template Engine<br />

License BSD License<br />

Website phaml.sourceforge.net [1]<br />

pHAML (<strong>PHP</strong> XHTML Abstraction Markup <strong>Language</strong>) is a <strong>PHP</strong>-centric variant of Haml. Haml is a markup<br />

language that is used to describe the XHTML of any web document without the use of traditional inline coding.<br />

pHAML adds additional <strong>PHP</strong> capabilities to Haml, beyond those provided by phpHaml, including template<br />

inclusion, variable inclusion, debugging capabilities. pHAML is live software in production in several sites.<br />

pHAML and Haml Similarities<br />

pHAML follows many of the same principle of Haml:<br />

• markup should be beautiful<br />

• Don't Repeat Yourself (DRY)<br />

• code should be well-indented - Like the Python programming language, indentation is part of the syntax of<br />

pHAML and Haml. Mixing spaces and tabs in indentation can produce unexpected results.<br />

• XHTML structure should be clear.<br />

pHAML uses the same tag syntax as Haml.<br />

pHAML and Haml Differences<br />

This solution was created to enhance Smarty, and also can be integrated into the Zend Framework. There have been<br />

other tweaks to assist in the creation of code. Also, <strong>PHP</strong> and Ruby share a bit, but are a bit different as well.<br />

• Attributes are literal: there is no Ruby array notation for attribute arrays.<br />

• Spaces are not tied to a multiple of two, but you should make your code spacing consistent in practice.<br />

• There are comments (not just the HTML kind).<br />

• There is no Ruby code integration.<br />

• There is <strong>PHP</strong> integration.<br />

• There are debugging commands, a simple template system, heredoc syntax, html character output, and html4<br />

doctype tags.<br />

• Smarty integration.<br />

• Zend Framework integration.<br />

• All in a single <strong>PHP</strong> class.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!