Cnz_Html
[ class tree: Cnz_Html ] [ index: Cnz_Html ] [ all elements ]

Class: Cnz_Html_Element

Source Location: /Html/Element.php

Class Overview


HTML Element class


Author(s):

Variables

Constants

Methods


Child classes:

Cnz_Html_Form_Abstract
HTML Form Abstract class
Cnz_Html_Form_Item
HTML Form Item class
Cnz_Html_Template
HTML Template class
Cnz_Html_Head
HTML Head class
Cnz_Html_Document
HTML Document class
Cnz_Html_Menu
HTML Menu class
Cnz_Html_Table
HTML Table class
Cnz_Html_Menu_Item
HTML Menu Item class
Cnz_Html_Table_Button
HTML Table Button class

Class Details

[line 94]
HTML Element class

This is an abstract base class for all high-level HTML display elements. Its primary function is to generate the configuration section names and style names in a standardized way.

The configuration section name is generated as

   HtmlType[-name]

where type is third field of class name and name is the element name passed to the constructor. For example, Cnz_Html_Form_Checkbox with a name of pay would yield HtmlFormPay.

The style name is generated as

   type[Subtype][-name][-suffix]

This design allows for a single default configuration section and/or style, with the ability to override the defaults for special elements.

Some elements will have special style suffixes (e.g., hilighted table rows). For example, a highlighted table row with the custom name team would have the following returned by genStyles().

   table table-team table-hilight table-team-hilight

Subtypes are only used for situations where the same HTML tag has different structural roles in the same complex element. For example, a form will use a div block to format the label for a field as well as the field itself, but different styling will normally be desired for these. For example, a form label with the custom name pay would have the following returned by genStyles().

   formLabel formLabel-pay

This allows the definition of default styles with overrides for named tables and special cases. Remember that the order of the style names in the class attribute is irrelevant. The order in the style sheet is what matters. The more specific styles should occur below the more general styles.

HTML id values can also be generated with genId(). This is generated as

   type[-name]




Tags:

abstract:  


[ Top ]


Class Variables

$config =  NULL

[line 115]



Tags:

access:  protected

Type:   Zend_Config


[ Top ]

$configFile =  NULL

[line 109]



Tags:

access:  protected

Type:   string


[ Top ]

$configSection =  NULL

[line 110]



Tags:

access:  protected

Type:   string


[ Top ]

$customConfigFlag =  false

[line 104]



Tags:

access:  protected

Type:   boolean


[ Top ]

$customStyleFlag =  false

[line 105]



Tags:

access:  protected

Type:   boolean


[ Top ]

$master =  NULL

[line 118]



Tags:

access:  protected

Type:   Cnz_Element


[ Top ]

$name =  NULL

[line 111]



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 152]

void __construct( [ &$options = array()], array $options)

Option fields:

string name Element name Cnz_Element master Master element string filename Configuration filename boolean config Has custom configuration boolean style Has custom style

Configuration fields: none




Tags:

access:  public


Overridden in child classes as:

Cnz_Html_Form_Abstract::__construct()
Option fields: default Associative array containing default field values row Zend_Db_Table_Row containing data for this form
Cnz_Html_Form_Group::__construct()
Option fields: none
Cnz_Html_Form::__construct()
Option fields: none
Cnz_Html_Form_Item::__construct()
Option fields: initial Initial value for this field
Cnz_Html_Form_Password::__construct()
Option fields: none
Cnz_Html_Form_Select::__construct()
Option fields: none
Cnz_Html_Form_Checkbox::__construct()
Option fields: none
Cnz_Html_Form_Radio::__construct()
Option fields: none
Cnz_Html_Form_File::__construct()
Option fields: none
Cnz_Html_Form_Text::__construct()
Option fields: none
Cnz_Html_Form_Hidden::__construct()
Option fields: none
Cnz_Html_Form_Textarea::__construct()
Option fields: none
Cnz_Html_Template::__construct()
Option fields: foo
Cnz_Html_Head::__construct()
Option fields:
Cnz_Html_Document::__construct()
Option fields: filename Document filename
Cnz_Html_Menu::__construct()
Option fields: list Menu item list
Cnz_Html_Table::__construct()
Option fields: none
Cnz_Html_Table_Csv::__construct()
Option fields: none
Cnz_Html_Table_Database::__construct()
Option fields: none
Cnz_Html_Menu_Item::__construct()
Cnz_Html_Table_Button::__construct()
Option fields: none

Parameters:

array   $options   Associative array of common options.
array   &$options  

[ Top ]

method display [line 134]


method genId [line 210]

string genId( [string $number = NULL])

Generates the id attribute value.



Tags:

return:  Value for use with HTML id attribute
access:  protected


Parameters:

string   $number  

[ Top ]

method genStyles [line 236]

string genStyles( [string $subtype = NULL], [string $suffix = NULL])

Generates the class attribute value.



Tags:

return:  List of styles for use with HTML class attribute
access:  protected


Parameters:

string   $subtype   Style name subtype
string   $suffix   Style name suffix

[ Top ]

method getName [line 123]

string getName( )



Tags:

return:  Name
access:  public


Overridden in child classes as:

Cnz_Html_Table_Button::getName()

[ Top ]


Class Constants

CONFIG_PREFIX =  'Html'

[line 96]


[ Top ]

STYLE_SEPARATOR =  '-'

[line 97]


[ Top ]



Documentation generated on Thu, 19 Jul 2007 15:02:01 -0400 by phpDocumentor 1.4.0RC2