Permalink
Browse files

added support for boolean and null in htmlAsIs

  • Loading branch information...
1 parent bcc37c4 commit d54efc6ded22520228834e5f8c8e02f3acdea2a8 @escribis committed Apr 5, 2012
Showing with 11 additions and 3 deletions.
  1. +11 −3 HTML.php
View
@@ -1,14 +1,22 @@
<?php
+require_once 'Strings.php' ;
require_once 'Structures.php' ;
/**
* Return a html string keeping the format of the existing string.
- * @param String! $string
+ * For convinence if the passed parameter is a boolean or the null value
+ * then display the corresponding value.
+ * @param String|Boolean|null $value
* @return HTML!
*/
-function htmlAsIs($string) {
- return '<pre>'.htmlentities($string).'</pre>' ;
+function htmlAsIs($value) {
+ if (is_bool($value)) {
+ $value = boolStr($value) ;
+ } else if ($value ===null) {
+ $value = "null" ;
+ }
+ return '<pre>'.htmlentities($value).'</pre>' ;
}
/*

0 comments on commit d54efc6

Please sign in to comment.