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

Class: HTMLselects

Source Location: /HTMLselects.php

Class Overview

Strings
   |
   --HTML
      |
      --HTMLselects

This class manages HTML select lists objects.


Author(s):

Version:

  • 1.3

Variables

Methods


Child classes:

HTMLselectsOptions
This class manages HTML select option objects.

Inherited Variables

Inherited Methods

Class: HTML

HTML::HTMLCloseTag()
HTML closing tag function
HTML::HTMLOpenTag()
HTML opening tag function

Class: Strings

Strings::__construct()
Construction function
Strings::console()
Console function
Strings::IsUTF8()
UTF8 detection function
Strings::QuoteStrip()
Quotes stripping function
Strings::RemoveAccent()
Accents removal function
Strings::RemoveSpaces()
Spaces removal function
Strings::stringHasNumbers()
Numbers detection function
Strings::ToUTF8()
UTF8 conversion function
Strings::ucwordsw()
Special uppercase function

Class Details

[line 34]
This class manages HTML select lists objects.

Created on 14 apr 09

Changes: 1.2 -> 1.3: 12 aug 09 updated: HTMLSelectConstruct() function is now compatible with selected HTML tag for options 1.1 -> 1.2: 17 jul 09 updated: file is PEAR compatible 1.0 -> 1.1: 06 may 09 added: to HTML package




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  1.3
license:  GNU Public License


[ Top ]


Class Variables

$html_needclose =  true

[line 45]

Variable that contains switch defining if tag needs to be closed



Tags:

access:  protected

Type:   bool
Overrides:   Array


[ Top ]

$html_tag =  "select"

[line 40]

Variable that contains tag



Tags:

access:  protected

Type:   string
Overrides:   Array


[ Top ]



Class Methods


method HTMLSelectClose [line 137]

string HTMLSelectClose( string $this->html_tag)

HTML closing select tag function

This function is used to close xHTML select tags. Result is stored in $this->html_output (added to the end of the string) and returned.

  1.  <?php
  2.  $oHTMLselects            new HTMLselects();
  3.  echo $oHTMLselects->HTMLSelectClose();
  4.  // </select>
  5.  ?>




Tags:

return:  xHTML string corresponding to closed tag
since:  version 1.0
usedby:  HTMLselects::HTMLSelectConstruct()
uses:  HTML::HTMLCloseTag()


Parameters:

string   $this->html_tag   xHTML tag to be opened

[ Top ]

method HTMLSelectConstruct [line 214]

string HTMLSelectConstruct( $aOptions, [string $name = null], [string $id = null], [string $class = null], [string $style = null], [array $aScript = null], array $aOption)

HTML select construction function

This function is used to construct xHTML select. Result is stored in $this->html_output (added to the end of the string) and returned.

  1.  <?php
  2.  $aOptions1 array(
  3.       "name"      =>  "myName1",
  4.       "id"        =>  "myID1",
  5.       "value"     =>  "myValue1",
  6.       "label"     =>  "myLabel1",
  7.       "class"     =>  "myClass1",
  8.       "style"     =>  "myStyle1",
  9.       "aScript"   =>  array("onclick" =>  "go();")
  10.  );
  11.  $aOptions2 array(
  12.       "name"      =>  "myName2",
  13.       "id"        =>  "myID2",
  14.       "value"     =>  "myValue2",
  15.       "label"     =>  "myLabel2",
  16.       "class"     =>  "myClass2",
  17.       "style"     =>  "myStyle2",
  18.       "aScript"   =>  array("onclick" =>  "go();",
  19.       "bSelected" =>  true
  20.       )
  21.  );
  22.  $aOptions  array($aOptions1$aOptions2);
  23.  $oSelect   new HTMLselects();
  24.  echo $oSelect->HTMLSelectConstruct(
  25.       $aOptions,
  26.       "selectName",
  27.       "selectID",
  28.       "selectClass",
  29.       "selectStyle",
  30.       array("onchange"    =>  "click();")
  31.  );
  32.  // <select name="selectName" id="selectID" class="selectClass"
  33.  style="selectStyle" onchange="click();"><option name="myName1" id="myID1"
  34.  value="myValue1" class="myClass1" style="myStyle1" onclick="go();">
  35.  myLabel1</option><option name="myName2" id="myID2" value="myValue2"
  36.  class="myClass2" style="myStyle2" onclick="go();" selected="selected">
  37.  myLabel2</option></select>
  38.  ?>




Tags:

return:  xHTML string corresponding to HTML select
since:  version 1.0
usedby:  WBcollection::renderHTMLselect()
uses:  HTMLselectsOptions::HTMLSelectOptionConstruct()
uses:  HTMLselects::HTMLSelectOpen()
uses:  HTMLselects::HTMLSelectClose()


Parameters:

array   $aOption   array containing options array (required)
string   $name   xHTML name tag
string   $id   xHTML id tag
string   $class   xHTML class tag
string   $style   xHTML style tag
array   $aScript   array containing scripts data
   $aOptions  

[ Top ]

method HTMLSelectOpen [line 88]

string HTMLSelectOpen( [string $name = null], [string $id = null], [string $class = null], [string $style = null], [array $aScript = null], string $this->html_tag, bool $this->html_needclose)

xHTML Select opening tag function

This function is used to open xHTML select tags. Result is stored in $this->html_output (added to the end of the string) and returned.

  1.  <?php
  2.  $aScript            array("onchange" => "go();");
  3.  $oSelect            new HTMLselects();
  4.  echo $oSelect->HTMLSelectOpen(
  5.       "fooName",
  6.       "barID",
  7.       "myClass",
  8.       "myStyle",
  9.       $aScript
  10.  );
  11.  // <select name="fooName" id="barID" class="myClass" style="myStyle"
  12.  onchange="go();">
  13.  ?>




Tags:

return:  xHTML string corresponding to opened tag
since:  version 1.0
usedby:  HTMLselects::HTMLSelectConstruct()
uses:  HTML::HTMLOpenTag()


Parameters:

string   $this->html_tag   xHTML tag to be opened
string   $name   xHTML name of the tag
string   $id   xHTML id of the tag
string   $class   xHTML class parameter
string   $style   xHTML style parameter
array   $aScript   scripts to be added
bool   $this->html_needclose   switch defining if the tag needs to be closed

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:22 +0200 by phpDocumentor 1.4.1