Loading Please 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

  <?= 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 ( list,
tag = "ul" 
)

Generates a List <ol/ul> with Tags from an array.

Parameters:
$list array
$tag string
Returns:
string

Definition at line 103 of file dict.php.

References $val.

Referenced by auto_ol(), and auto_ul().

00103                                       {
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 }

auto_ol ( list,
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:
$list array
$attr array Optinal
Returns:
string

Definition at line 122 of file dict.php.

References auto_list().

00122                                      {
00123   $ret  = '';
00124   $ret .= "<ol".merge_attr($attr).">\n";
00125   $ret .= auto_list($list, "ol");
00126   $ret .= "</ol>";
00127   return $ret;
00128 }

Here is the call graph for this function:

auto_ul ( list,
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:
$list array
$attr array Optinal
Returns:
string

Definition at line 137 of file dict.php.

References auto_list().

00137                                      {
00138   $ret  = '';
00139   $ret .= "<ul".merge_attr($attr).">\n";
00140   $ret .= auto_list($list, "ul");
00141   $ret .= "</ul>";
00142   return $ret;
00143 }

Here is the call graph for this function:

brk ( num = 0  ) 

Generates Line Breaks of specified ammount.

Parameters:
$num int Optinal
Returns:
string

Definition at line 164 of file dict.php.

Referenced by HtmlTag::br().

00164                       {
00165   $ret = '';
00166   for($i=0;$i<$num;$i++){
00167     $ret .= "<br />";
00168   }
00169   return $ret;
00170 }

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.

Parameters:
$srcPath string
$name string Optinal
$attr array Optinal
Returns:
string

Definition at line 180 of file dict.php.

References merge_attr().

00180                                                 {
00181   $ret = '<img src="'.$src.'" ';
00182   if(!is_null($name)){
00183     $ret .= 'name="'.$name.'" ';
00184   }
00185   $ret .= merge_attr($attr)."/>";
00186   return $ret;
00187 }

Here is the call graph for this function:

merge_attr ( attr  ) 

Merges the attributes array into a String.

Parameters:
$attr array
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().

00088                           {
00089   if(is_null($attr))return '';
00090   $ret = '';
00091   foreach($attr as $key => $val){
00092     $ret .= $key.'="'.$val.'" ';
00093   }
00094   return $ret;
00095 }

spc ( num = 0  ) 

Generates Non Breaking Spaces of specified ammount.

Parameters:
$num int Optinal
Returns:
string

Definition at line 150 of file dict.php.

Referenced by HtmlTag::nbsp().

00150                       {
00151   $ret = '';
00152   for($i=0;$i<$num;$i++){
00153     $ret .= "&nbsp;";
00154   }
00155   return $ret;
00156 }


Generated on Mon Oct 27 23:52:55 2008 for zigmoyd.kdevelop by doxygen 1.5.6