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

Class: HTMLselectsOptions

Source Location: /HTMLselectsOptions.php

Class Overview

Strings
   |
   --HTML
      |
      --HTMLselects
         |
         --HTMLselectsOptions

This class manages HTML select option objects.


Author(s):

Version:

  • 1.3

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTMLselects

HTMLselects::HTMLSelectClose()
HTML closing select tag function
HTMLselects::HTMLSelectConstruct()
HTML select construction function
HTMLselects::HTMLSelectOpen()
xHTML Select opening tag function

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 35]
This class manages HTML select option objects.

Created on 14 apr 09

Changes: 1.2 -> 1.3: 12 aug 09 updated: HTMLSelectOptionOpen() and HTMLSelectOptionConstruct() functions are now compatible with selected option 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 46]

Variable that contains switch defining if tag needs to be closed



Tags:

access:  protected

Type:   bool
Overrides:   Array


[ Top ]

$html_tag =  "option"

[line 41]

Variable that contains tag



Tags:

access:  protected

Type:   string
Overrides:   Array


[ Top ]



Class Methods


method HTMLSelectOptionClose [line 148]

string HTMLSelectOptionClose( 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.  $oHTMLoptions            new HTMLselectsOptions();
  3.  echo $oHTMLoptions->HTMLSelectOptionClose();
  4.  // </option>
  5.  ?>




Tags:

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


Parameters:

string   $this->html_tag   xHTML tag to be opened

[ Top ]

method HTMLSelectOptionConstruct [line 222]

string HTMLSelectOptionConstruct( [string $name = null], [string $id = null], [string $value = null], [string $label = null], [string $class = null], [string $style = null], [array $aScript = null], [bool $bSelected = false])

HTML select option construction function

This function is used to construct xHTML select option. 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.  $aOptions  array($aOptions1$aOptions2);
  22.  $oSelect   new HTMLselects();
  23.  echo $oSelect->HTMLSelectConstruct(
  24.       $aOptions,
  25.       "selectName",
  26.       "selectID",
  27.       "selectClass",
  28.       "selectStyle",
  29.       array("onchange"    =>  "click();")
  30.  );
  31.  // <option name="myName" id="myID" value="myValue" class="myClass"
  32.  style="myStyle" onfocus="go();">myLabel</option>
  33.  ?>




Tags:

return:  xHTML string corresponding to HTML select
since:  version 1.0
usedby:  HTMLselects::HTMLSelectConstruct()
uses:  HTMLselectsOptions::HTMLSelectOptionClose()
uses:  HTMLselectsOptions::HTMLSelectOptionOpen()


Parameters:

string   $name   xHTML name of the tag
string   $id   xHTML id of the tag
string   $value   xHTML value of the tag
string   $label   xHTML label option of the tag
string   $class   xHTML class of the tag
string   $style   xHTML style of the tag
array   $aScript   array containing scripts data
bool   $bSelected   true if option must be selected

[ Top ]

method HTMLSelectOptionOpen [line 88]

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

xHTML Option opening tag function

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

  1.  <?php
  2.  $oSelectOptions new HTMLselectsOptions();
  3.  echo $oSelectOptions->HTMLSelectOptionOpen(
  4.       "fooName",
  5.       "barID",
  6.       "myClass",
  7.       "myStyle"
  8.  );
  9.  // <option name="fooName" id="barID" class="myClass" style="myStyle">
  10.  ?>




Tags:

return:  xHTML string corresponding to opened tag
since:  version 1.0
usedby:  HTMLselectsOptions::HTMLSelectOptionConstruct()
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   $value   xHTML value of the tag
string   $class   xHTML class parameter
string   $style   xHTML style parameter
array   $aScript   scripts to be added
bool   $bSelected   true if option must be selected
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