diff --git a/LICENSE b/LICENSE index 9d70b4d..cea2704 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 Canteen +Copyright (c) 2013 Matt Karl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index af5b8ba..0ba4615 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,225 @@ -CanteenHTML5 -============ +#CanteenHTML5 -Create dynamic, valid HTML5 markup with a simple an intuitive PHP API +Create dynamic, well-formatted HTML5 markup with a simple an intuitive PHP API. This is a fork/rewrite of the [Gagawa](https://code.google.com/p/gagawa/) project. CanteenHTML5 is a concise, flexible and easy to remember API which makes it possible to create simple markup (such as a link) or more complex structures (such a table, document or nested list). All tags and attribute names are validated against the current HTML5 specification. + +##Requirements + + +This library requires a webserver running PHP 5.3+. Also, the root namespace for the library is `Canteen\HTML5`. + +##Installation + +Simply include the `html.php` file. + +```php +include 'lib/html.php'; +``` + +##Usage + +###Basic +To create an HTML node, simply call global `html` method, passing in the tag name and then any attributes. + +```php +echo html('img src=home.jpg'); +echo html('img', 'src=home.jpg'); +echo html('img', array('src'=>'home.jpg')); +``` + +All of these examples would output: + +```html + +``` + +###Adding Attributes + +There are dfferent ways to add attributes for HTML container nodes such as `

`, `

`, or in the example below, `