Permalink
Browse files

add +h+ alias for +Html+ class

  • Loading branch information...
1 parent f9c4938 commit 31646954a1e7cda0362f6c37cc3f8aa181ad6618 @naomik naomik committed Feb 28, 2011
Showing with 31 additions and 28 deletions.
  1. +3 −0 class.html.php
  2. +14 −14 example.php
  3. +14 −14 readme.md
View
@@ -119,4 +119,7 @@ static private function outdent(){
}
+# alias +h+ class
+if(!class_exists("h")){ class h extends Html {} };
+
?>
View
@@ -2,27 +2,27 @@
require "class.html.php";
-Html::set_indent_pattern(" ");
+h::set_indent_pattern(" ");
-Html::html(function(){
- Html::head(function(){
- Html::meta(array("http-equiv"=>"Content-Type", "content"=>"text/html; charset=UTF-8"));
- Html::link(array("rel"=>"stylesheet", "type"=>"text/css", "href"=>"global.css"));
+h::html(function(){
+ h::head(function(){
+ h::meta(array("http-equiv"=>"Content-Type", "content"=>"text/html; charset=UTF-8"));
+ h::link(array("rel"=>"stylesheet", "type"=>"text/css", "href"=>"global.css"));
});
- Html::body(function(){
- Html::div(array("id"=>"wrapper"), function(){
- Html::h1("Hello, World", array("class"=>"title"));
+ h::body(function(){
+ h::div(array("id"=>"wrapper"), function(){
+ h::h1("Hello, World", array("class"=>"title"));
- Html::comment("navigation");
- Html::ul(array("class"=>"links"), function(){
+ h::comment("navigation");
+ h::ul(array("class"=>"links"), function(){
foreach(array(1,2,3) as $x)
- Html::li(function() use($x) {
- Html::a("Link {$x}", "#{$x}");
+ h::li(function() use($x) {
+ h::a("Link {$x}", "#{$x}");
});
});
- Html::comment("let's see some text");
- Html::p("Lorem ipsum dolor sit amet, consectetur adipisicing elit...");
+ h::comment("let's see some text");
+ h::p("Lorem ipsum dolor sit amet, consectetur adipisicing elit...");
});
});
View
@@ -12,27 +12,27 @@ PHP >= 5.3
require "class.html.php";
- Html::set_indent_pattern(" ");
+ h::set_indent_pattern(" ");
- Html::html(function(){
- Html::head(function(){
- Html::meta(array("http-equiv"=>"Content-Type", "content"=>"text/html; charset=UTF-8"));
- Html::link(array("rel"=>"stylesheet", "type"=>"text/css", "href"=>"global.css"));
+ h::html(function(){
+ h::head(function(){
+ h::meta(array("http-equiv"=>"Content-Type", "content"=>"text/html; charset=UTF-8"));
+ h::link(array("rel"=>"stylesheet", "type"=>"text/css", "href"=>"global.css"));
});
- Html::body(function(){
- Html::div(array("id"=>"wrapper"), function(){
- Html::h1("Hello, World", array("class"=>"title"));
+ h::body(function(){
+ h::div(array("id"=>"wrapper"), function(){
+ h::h1("Hello, World", array("class"=>"title"));
- Html::comment("navigation");
- Html::ul(array("class"=>"links"), function(){
+ h::comment("navigation");
+ h::ul(array("class"=>"links"), function(){
foreach(array(1,2,3) as $x)
- Html::li(function() use($x) {
- Html::a("Link {$x}", "#{$x}");
+ h::li(function() use($x) {
+ h::a("Link {$x}", "#{$x}");
});
});
- Html::comment("let's see some text");
- Html::p("Lorem ipsum dolor sit amet, consectetur adipisicing elit...");
+ h::comment("let's see some text");
+ h::p("Lorem ipsum dolor sit amet, consectetur adipisicing elit...");
});
});

0 comments on commit 3164695

Please sign in to comment.