Formatting output Plese Wait...
HTML helper.
This file is part of Zigmoyd PHP Framework.
More...
|
Data Structures |
class | HtmlTag |
| Parent class of all Html Tag Classes. More...
|
class | font |
| The Class for font Tag. More...
|
class | span |
| The Class for span Tag. More...
|
class | label |
| The Class for label Tag. More...
|
class | form |
| HTML Form Helper This Class Can generete verious HTML Tags related To form like TextBox, CheckBox, selectBox etc. More...
|
class | bold |
| Represents the Bold tag. More...
|
class | italics |
| Represents the Italics tag. More...
|
class | underline |
| Represents the underline tag. More...
|
Functions |
| merge_attr ($attr) |
| Merges the attributes array into a String.
|
| auto_list ($list, $tag="ul") |
| Generates a List <ol/ul> with Tags from an array.
|
| auto_ol ($list, $attr=null) |
| Generate's an Ordered List with.
|
| auto_ul ($list, $attr=null) |
| Generate's an unOrdered List with.
|
| spc ($num=0) |
| Generates Non Breaking Spaces of specified ammount.
|
| brk ($num=0) |
| Generates Line Breaks of specified ammount.
|
| image ($src, $name=null, $attr=null) |
| Generates Image Tags You can also Specify additional attributes for the Tag throught an associatiove array as the 2nd and Optional Argument.
|
Detailed Description
This file is part of Zigmoyd PHP Framework.
Copyright (C) 2008 Neel Basu (Sunanda Bose)
Zigmoyd PHP Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Zigmoyd PHP Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Zigmoyd PHP Framework. If not, see <http://www.gnu.org/licenses/>.
Classes and functions that expands to HTML tags and attributes. e.g. if you want to print <span name="hi" class="error">Error Message</span>
you can use
Show Source <?= span::open('hi', 'error') ?>Error Message<?= span::close() ?>
all HTML tag classes extends from
HtmlTag Class. all pair tags have an
open()
and an
close()
operation that can be used to open and close those pair tags.
Function Documentation
auto_list( array $list, string $tag = "ul"
)
Generates a List <ol/ul> with Tags from an array.
- Parameters:
-
- Returns:
- string
Definition at line 103 of file dict.php.
References $val.
Referenced by auto_ol(), and auto_ul().
Show Source00103 {
00104 $ret = '';
00105 foreach($list as $key => $val){
00106 if(is_array($val)){
00107 $ret .= "<li>".$key."\n<$tag>\n".auto_list($val, $tag)."</$tag>\n";
00108 }else{
00109 $ret .= "<li>".$val."</li>\n";
00110 }
00111 }
00112 return $ret;
00113 }
Top
auto_ol( array $list, array $attr = null
)
Generate's an Ordered List with.
from an array You can also Specify additional attributes for the Tag throught an associatiove array as the 2nd and Optional Argument
- Parameters:
-
- Returns:
- string
Definition at line 122 of file dict.php.
References auto_list().
Show Source00122 {
00123 $ret = '';
00124 $ret .= "<ol".merge_attr($attr).">\n";
00125 $ret .= auto_list($list, "ol");
00126 $ret .= "</ol>";
00127 return $ret;
00128 }
Top
auto_ul( array $list, array $attr = null
)
Generate's an unOrdered List with.
from an array You can also Specify additional attributes for the Tag throught an associatiove array as the 2nd and Optional Argument
- Parameters:
-
- Returns:
- string
Definition at line 137 of file dict.php.
References auto_list().
Show Source00137 {
00138 $ret = '';
00139 $ret .= "<ul".merge_attr($attr).">\n";
00140 $ret .= auto_list($list, "ul");
00141 $ret .= "</ul>";
00142 return $ret;
00143 }
Top
Generates Line Breaks of specified ammount.
- Parameters:
-
- Returns:
- string
Definition at line 164 of file dict.php.
Referenced by HtmlTag::br().
Show Source00164 {
00165 $ret = '';
00166 for($i=0;$i<$num;$i++){
00167 $ret .= "<br />";
00168 }
00169 return $ret;
00170 }
Top
image( int $src, string $name = null
, array $attr = null
)
Generates Image Tags You can also Specify additional attributes for the Tag throught an associatiove array as the 2nd and Optional Argument.
- Parameters:
-
| $srcPath | string |
| $name | Optinal |
| $attr | Optinal |
- Returns:
- string
Definition at line 180 of file dict.php.
References merge_attr().
Show Source00180 {
00181 $ret = '<img src="'.$src.'" ';
00182 if(!is_null($name)){
00183 $ret .= 'name="'.$name.'" ';
00184 }
00185 $ret .= merge_attr($attr)."/>";
00186 return $ret;
00187 }
Top
merge_attr( array $attr )
Merges the attributes array into a String.
- Parameters:
-
- Returns:
- string
Definition at line 88 of file dict.php.
References $val.
Referenced by form::checkbox(), form::file(), form::hidden(), image(), underline::open(), italics::open(), bold::open(), label::open(), span::open(), font::open(), form::password(), form::radio(), form::select(), form::start(), form::startMultipart(), form::submit(), and form::textbox().
Show Source00088 {
00089 if(is_null($attr))return '';
00090 $ret = '';
00091 foreach($attr as $key => $val){
00092 $ret .= $key.'="'.$val.'" ';
00093 }
00094 return $ret;
00095 }
Top
Generates Non Breaking Spaces of specified ammount.
- Parameters:
-
- Returns:
- string
Definition at line 150 of file dict.php.
Referenced by HtmlTag::nbsp().
Show Source00150 {
00151 $ret = '';
00152 for($i=0;$i<$num;$i++){
00153 $ret .= " ";
00154 }
00155 return $ret;
00156 }
Top