Xyndravandria Averazain  Alpha 0.0.0
 All Data Structures Namespaces Functions Variables
HTMLBuilder Class Reference

Static Public Member Functions

static ArgumentListing (array $Arguments)
 
static Form ($IndexFile, $Class, $Method, $InnerHTML, array $AdditionalArguments=array(), array $Assigments=array())
 
static Hyperlink ($IndexFile, $Class, $Method, $Arguments=array(), $InnerHTML= '', array $Assigment=array())
 

Static Private Member Functions

static AssigmentListing (array $Assigments)
 

Member Function Documentation

static ArgumentListing ( array  $Arguments)
static

Creates two argument listing for the hash and JavaScript method.

Parameters
array$Arguments,:The arguments to be parsed.
Returns
array of string
Note
Lastly, if you would like to pass a JavaScript expression (function call, attribute, ...) on client level as an (additional) parameter
  • which should therefore not be put between string quotes -, pass it as an array. Since the expression will logically not be added to the GET arguments of the file assigned to the target attribute of the form tag, you have to pass another value which should be passed as a GET argument. This is relevant when it comes to JavaScript disabled clients. To sum up, the array structure has to be: ( [0] => [JavaScript expression] ; [1] => [GET argument] )
static AssigmentListing ( array  $Assigments)
staticprivate

Creates an assigment listing used within a HTML tag.

Parameters
array$Assigments,:The assigments as an array.
Returns
string
static Form (   $IndexFile,
  $Class,
  $Method,
  $InnerHTML,
array  $AdditionalArguments = array( ),
array  $Assigments = array( ) 
)
static

Generates a form tag.

Parameters
string$IndexPage,:The index file of your website.
string$Class,:The class whose method the form data is to be passed.
string$Method,:The method of the class the form data is to be passed to.
array$AdditionalArguments,:Additional Arguments to be passed to the method.
string$InnerHTML,:The inner HTML of the form tag.
array$Assigments,:Further assigments within the form tag, for instance used to set a class attribute. The indexes of the array refer to the attributes of the HTML tag.
Note
Both $AdditionalArguments and $Assigments are optional parameters.
Furthermore, $AdditionalArguments may also contain $Assigments. Whether $AdditionalArguments really contains additional arguments or assigments is determined by checking whether there is at least one string index.
Lastly, if you would like to pass a JavaScript expression (function call, attribute, ...) on client level as an (additional) parameter - which should therefore not be put between string quotes -, pass it as an array. Since the expression will logically not be added to the GET arguments of the file assigned to the target attribute of the form tag, you have to pass another value which should be passed as a GET argument. This is relevant when it comes to JavaScript disabled clients. To sum up, the array structure has to be: ( [0] => [JavaScript expression] ; [1] => [GET argument] )
Tip: Always distribute the URL with the GET arguments and not the one with the JavaScript hash when externally linking to a page. Whenever a JavaScript enabled client requests a site via GET arguments, Averazain will automatically make the client reload the page to change the URL to the other one with JavaScript hash while also of course cutting of the GET arguments.

Technical explanation: The onsubmit event of the form tag will only be called if a client does support JavaScript and in case that happens, due to the 'return false;', the client will not send the data to the hyperlink assigned to the action attribute after invoking the onsubmit event. If JavaScript is disabled, the client will normally send the data to the hyperlink and not invoke the onsubmit event.
Furthermore, the AttachForm( ) method will be called in the onsubmit event to tell Averazain to also pass the form data within the Ajax request before it is sent.
Eventually, there will be added the prefix to the name attribute of any input, select and textarea tag. This is necessary to make it possible for Averazain to later distinguish form values from method arguments in order to save them into Averazain::$FormData.
static Hyperlink (   $IndexFile,
  $Class,
  $Method,
  $Arguments = array( ),
  $InnerHTML = '',
array  $Assigment = array( ) 
)
static

Generates an anchor tag.

Parameters
string$IndexFile,:The index file of your website.
string$Class,:The class whose method is to be called.
string$Method,:The method to be called.
array$Arguments,:Arguments to be passed to the method.
string$InnerHTML,:The inner HTML of the anchor tag.
array$Assigments,:Further assigments within the anchor tag, for instance used to set a class attribute. The indexes of the array refer to the attributes of the HTML tag.
Note
Both $Arguments, $InnerHTML and $Assigments are optional parameters.
$InnerHTML is not passed or empty, the hyperlink itself will be put between the anchor tags.
Furthermore,
HTMLBuilder::HyperLink( 'Index.php', 'Class', 'Method', array( ), 'Inner HTML' ) == HTMLBuilder::Hyperlink( 'Index.php', 'Class', 'Method', 'Inner HTML' ) 
Lastly, if you would like to pass a JavaScript expression (function call, attribute, ...) on client level as an (additional) parameter - which should therefore not be put between string quotes -, pass it as an array. Since the expression will logically not be added to the GET arguments of the file assigned to the target attribute of the form tag, you have to pass another value which should be passed as a GET argument. This is relevant when it comes to JavaScript disabled clients. To sum up, the array structure has to be: ( [0] => [JavaScript expression] ; [1] => [GET argument] )

Technical explanation: The onclick event of the anchor tag will only be called if a client does support JavaScript and in case that happens, due to the 'return false;', the client will not follow the hyperlink assigned to the href attribute after invoking the onclick event. If JavaScript is disabled, the client will normally follow the hyperlink and not invoke the onclick event.