Copied!

The basic HTML5Element that handles common Foundation things and HTML closing tags

Cloneable Instantiable
Constants
public PHPFUI\Base ::DEBUG_SOURCE = 1
Methods
public __clone ()
public __construct ( string $element )
 

Construct an object with the tag name, ie. DIV, SPAN, TEXTAREA, etc

public PHPFUI\Base :: __toString () : string
public PHPFUI\Base :: add ( $item )
 

Base add function. Adds to the end of the current objects

public PHPFUI\Base :: addAsFirst ( $item )
 

Base addAsFirst function. Adds to the front of the current
object

public addAttribute ( string $attribute , string $value = '' ) : PHPFUI\HTML5Element
 

Add an attribute the the object

public addClass ( string $class ) : PHPFUI\HTML5Element
 

Add a class to an object

public PHPFUI\Base :: count () : int
 

Number of object in this object. Does not count sub objects.

public deleteAttribute ( string $attribute ) : PHPFUI\HTML5Element
 

Deletes the passed attribute

public deleteAttributes () : PHPFUI\HTML5Element
 

Deletes all attributes

public deleteClass ( string $classToDelete ) : PHPFUI\HTML5Element
 

Delete a class from the object

public disabled () : PHPFUI\HTML5Element
 

Disabled the element

public PHPFUI\Base :: done ( bool $done = true ) : PHPFUI\Base
 

Form is done rendering

public getAttribute ( string $attribute ) : string
 

Get an attribute

  • return ?string does not exist if null
public getAttributes () : string
 

Returns the attribute strings. Attributes with values are returned as name/value pairs,
attributes without values are returned as just the attribute name.

public getClass () : string
 

Returns the class attribute ready for insertion into an element.

public getClasses () : array
 

Returns all classes for the object

public static PHPFUI\Base :: getDebug ( int $flags = 0 ) : int
 

Gets the current debug setting

public getElement () : string
 

Return the type of the element

public getId () : string
 

Return the id of the object. Elements will not have an id unless this method is called. The id is returned as a string
starting with id followed by a unique number to the page. Id numbers are deterministic and start start with 1. Once assigned
an id, an element will always have the same id. It will get a new id if cloned.

public getIdAttribute () : string
 

Return the id attribute of the object as a name/value pair. If no id has been requested, and empty string is returned.

public PHPFUI\Base :: getResponse () : string
 

Get the current response

public getToolTip ( string $label )
 

Get the tool tip as a string

  • return PHPFUI\ToolTip | string return type depends on if the tip was set as a string or ToolTip object.
public hasClass ( string $class ) : bool
 

Return true if the class is present on the object

public hasId () : bool
 

Does this object have an id set already?

public hasToolTip () : bool
 
  • return bool if there is a tool tip associated with this element
public PHPFUI\Base :: isDone () : bool
 

Returns true if the page needs no more processing

public newId () : PHPFUI\HTML5Element
 

Assign a new id to this element.

public PHPFUI\Base :: output () : string
 

Output the object (convert to string)

public PHPFUI\Base :: prepend ( $item ) : PHPFUI\Base
 

Add an object in front of existing object

public setAttribute ( string $attribute , string $value = '' ) : PHPFUI\HTML5Element
 

Set the attribute overwriting the prior value

public setConfirm ( $text ) : PHPFUI\HTML5Element
 

A simple way to set a confirm on click

public static PHPFUI\Base :: setDebug ( int $level = 0 ) : void
 

Set the debug level, 1 or higher is on

public setElement ( $element ) : PHPFUI\HTML5Element
 

You can set the element type if you need to morph it for some reason

public setId ( $id ) : PHPFUI\HTML5Element
 

Set the base id of the object

public PHPFUI\Base :: setRawResponse ( string $response ) : PHPFUI\Base
 

Sets the page response directly

public PHPFUI\Base :: setResponse ( string $response , string $color = 'lime' ) : PHPFUI\Base
 

Set a response in the standard format ('reponse' and 'color' array)

public setToolTip ( $tip ) : PHPFUI\HTML5Element
 

Set the tool tip. Can either be a ToolTip or a string. If it is a string, it will be converted to a ToolTip

public toggleAnimate ( PHPFUI\HTML5Element $element , string $animation ) : PHPFUI\HTML5Element
 

Will toggle the provided element on click with the provided animation.

public toggleClass ( PHPFUI\HTML5Element $element , string $class ) : PHPFUI\HTML5Element
 

Will toggle the class on the provided element on click.

public transferAttributes ( PHPFUI\HTML5Element $from ) : PHPFUI\HTML5Element
 

Moves attributes into this object from the passed object

public transferClasses ( PHPFUI\HTML5Element $from ) : PHPFUI\HTML5Element
 

Moves classes into this object from the passed object

public PHPFUI\Base :: walk ( string $method , $argument = NULL )
 

Recursively walks all objects and calls the passed method on each object where it exists

  • return $this
Methods
protected getBody () : string
protected getEnd () : string
protected getStart () : string
protected upCastCopy ( PHPFUI\HTML5Element $to , PHPFUI\HTML5Element $from ) : PHPFUI\HTML5Element
 

Clones the first object and fills it with properties from the second object

Properties
private $attributes
private $classes
private $element
private $id
private static $masterId = 8
private $noEndTag
private static $noEndTags = [ 'area' => true , 'base' => true , 'br' => true , 'col' => true , 'command' => true , 'embed' => true , 'hr' => true , 'img' => true , 'input' => true , 'keygen' => true , 'link' => true , 'meta' => true , 'param' => true , 'source' => true , 'track' => true , 'wbr' => true ]
private $tooltip
Properties
private static $masterId = 8
private static $noEndTags = [ 'area' => true , 'base' => true , 'br' => true , 'col' => true , 'command' => true , 'embed' => true , 'hr' => true , 'img' => true , 'input' => true , 'keygen' => true , 'link' => true , 'meta' => true , 'param' => true , 'source' => true , 'track' => true , 'wbr' => true ]
Methods
public static PHPFUI\Base :: getDebug ( int $flags = 0 ) : int
 

Gets the current debug setting

public static PHPFUI\Base :: setDebug ( int $level = 0 ) : void
 

Set the debug level, 1 or higher is on

© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only