PHAML

PHAML

Infobox_Software
name = pHAML
developer = David Moring
latest_release_version = 0.9 (preview release)
latest_release_date = August 4, 2007
operating_system = Cross-platform
genre = Template Engine
license = MIT License
website = [http://i.cloudi.us/phaml/ i.cloudi.us]

pHAML (php XHTML Abstraction Markup Language) is a PHP-centric variant of Haml. Haml is a markup language that is used to cleanly and simply describe the XHTML of any web document without the use of traditional inline coding.

pHAML adds additional PHP capabilities to Haml, beyond those provided by phpHaml, including template inclusion, variable inclusion, debugging capabilities that have proven valuable and time savings in development. pHAML is live software in production in several sites.

pHAML and Haml Similarities

There is no greater fan of the principles behind HAML than pHAML, markup should be beautiful, DRY (don't repeat yourself), well-indented, and the XHTML structure should be clear.
* The tag creating syntax was kept the same.
* Spaces are VERY important—tabs and spaces are not equal and may produce “interesting” results (hence the addition of the debugging capability).

pHAML and Haml Differences

This solution was created to enhance Smarty, and also can be integrated into the Zend Framework. There have been other tweaks to assist in the creation of code. Also, PHP and Ruby share a bit, but are a bit different as well.
* Attributes are literal: there is no Ruby array notation for attribute arrays.
* Spaces are not tied to a multiple of two (fight the man!!), but you should make your code spacing consistent in practice.
* There are comments (not just the HTML kind).
* There is no Ruby code integration.
* There is PHP integration.
* There are debugging commands, a simple template system, heredoc syntax, html character output, and html4 doctype tags.
* Smarty integration.
* Zend Framework integration.
* All in a compact single PHP class.

Examples

Example of Code

The pHAML Code

!!!%html %head %title Hello World %body %b Hello World

Generated Template:
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html>
3 <head>
4 <title>
5 Hello World
6 </title>
7 </head>
8 <body>
9 <b>
10 Hello World
11 </b>
12 </body>
13 </html>
14

"The HTML output listing with line numbers is a function in the Zend Framework View that is under testing and will be release with the 1.0 version."

Example with Embedded Debugger On

By simply starting a line with a '?', the class will produce HTML comments that are useful in debugging.

?!!!%html %head %title Hello World %body %b Hello World

Generated Template:
1 <!-- Debug on -->
2 <!-- 3:4{!!!}: !!! -->
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <!-- 4:4: %html -->
5 <html>
6 <!-- 5:6: %head -->
7 <head>
8 <!-- 6:8: %title Hello World -->
9 <title>
10 Hello World
11 <!-- 7:6: %body -->
12 </title>
13 </head>
14 <body>
15 <!-- 8:8: %b Hello World -->
16 <b>
17 Hello World
18 </b>
19 </body>
20 </html>
21

Current Status

Technical preview is available at Source Forge, [http://phaml.sourceforge.net Source Forge Site] .

External links

* [http://i.cloudi.us/phaml/documentation Documentation]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Haml — Тип Язык разметки Разработчик Hampton Catlin, Nathan Weizenbaum Написана на Ruby (официальная версия) Последняя версия 3.1.2 …   Википедия

  • Haml — Infobox Software name = Haml developer = Hampton Catlin, Nathan Weizenbaum latest release version= 2.0.2 latest release date = release date|2008|07|29 operating system = Cross platform genre = Template Engine license = MIT License website =… …   Wikipedia

  • Haml — Vorlage:Infobox Dateiformat/Wartung/MIME fehltVorlage:Infobox Dateiformat/Wartung/MagischeZahl fehltVorlage:Infobox Dateiformat/Wartung/Standard fehlt Haml Dateiendung …   Deutsch Wikipedia

  • Phlox amoena Sims ssp. lighthipei (Small) Wherry — Symbol PHAML Common Name Lighthipe s phlox Botanical Family Polemoniaceae …   Scientific plant list

  • Phlox amoena Sims ssp. lighthipei (Small) Wherry — Symbol PHAML Common Name Lighthipe s phlox Botanical Family Polemoniaceae …   Scientific plant list

  • Phlox lighthipei Small — Symbol PHAML Synonym Symbol PHLI8 Botanical Family Polemoniaceae …   Scientific plant list

  • Phlox amoena ssp. lighthipei — ID 62683 Symbol Key PHAML Common Name Lighthipe s phlox Family Polemoniaceae Category Dicot Division Magnoliophyta US Nativity Native to U.S. US/NA Plant Yes State Distribution FL, GA, SC Growth Habit Subshrub, Shrub, Forb/herb …   USDA Plant Characteristics

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”