Copied!

A container to add objects to that will output a fully formed HTML page with no Foundation libraries.

CloneableInstantiable
Constants
public PHPFUI\Base::DEBUG_SOURCE = 1
Methods
public PHPFUI\Base::__clone()
public __construct()
public PHPFUI\Base::__toString() : string
public add( $item) : static
 

Add to the body element directly

public PHPFUI\Base::addAsFirst(?mixed $item) : static
 

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

  • param mixed $item should be convertable to string
public addCSS(string $css) : static
 

Add dedupped inline css

public addHeadJavaScript(string $js) : static
 

Add dedupped JavaScript to the header

public addHeadScript(string $module, array $attributes = []) : PHPFUI\Interfaces\Page
 

Add a dedupped header script

  • param string $module path to script
  • param array<string,string> $attributes key is attribute, value is option
public addHeadTag(string $tag) : PHPFUI\Interfaces\Page
 

Add a meta tag to the head section of the page

public addIEComments(string $comment) : PHPFUI\Interfaces\Page
 

Add IE commands. For example you should restrict IE 8 and lower clients.

$page->addIEComments('<!--[if lt IE9]><script>window.location="/old/index.html";</script><![endif]-->');
public addJavaScript(string $js) : PHPFUI\Interfaces\Page
 

Add dedupped JavaScript to the page

public addJavaScriptFirst(string $js) : PHPFUI\Interfaces\Page
 

Add dedupped JavaScript as the first JavaScript before Foundation

public addJavaScriptLast(string $js) : PHPFUI\Interfaces\Page
 

Add dedupped JavaScript as the last JavaScript on the page

public addStyleSheet(string $module) : PHPFUI\Interfaces\Page
 

Add dedupped Style Sheet to the page

  • param string $module filename
public addTailScript(string $module, array $attributes = []) : PHPFUI\Interfaces\Page
 

Add a dedupped script to the end of the page

  • param string $module path to script
  • param array<string,string> $attributes key is attribute, value is option
public PHPFUI\Base::count() : int
 

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

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

Form is done rendering

public getBaseURL() : string
 

Return just the base URI without the query string

public getBodyElement() : PHPFUI\Container
 

Direct access to the page body element. Also accessed via add method.

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

Gets the current debug setting

public getFavIcon() : string
 

Return the Fav Icon

public getPageName() : string
 

Return the current page name

public getQueryParameters() : array
 

Returns array of the current query parameters

public getQueryString() : string
 

Returns the query string with leading ? if set

public getResourcePath(string $resource = '') : string
 

Get fully qualified resource path root relative with resource if passed

A $resource starting with / or http is not modified

public PHPFUI\Base::getResponse() : string
 

Get the current response

public hasDatePicker() : bool
 

return true if it has a built in date picker detectable by HTTP_USER_AGENT

public hasDateTimePicker() : bool
 

return true if it has a built in date time picker detectable by HTTP_USER_AGENT

public hasTimePicker() : bool
 

return true if it has a built in time picker detectable by HTTP_USER_AGENT

public isAndroid() : bool
 

Return true if Android platform

public isChrome() : bool
 

Return true if Chrome browser

public PHPFUI\Base::isDone() : bool
 

Returns true if the page needs no more processing

public isIEMobile() : bool
 

Return true if Windows Mobile browser

public isIOS() : bool
 

Return true if IOS platform

public PHPFUI\Base::prepend(?mixed $item) : static
 

Add an object in front of existing object

public redirect(string $url = '', string $parameters = '', int $timeout = 0) : PHPFUI\Interfaces\Page
 

Redirect page. Default will redirect to the current page minus query string. Pass formatted query string as $parameter with no leading ?.

  • param string $url default '', current url
  • param string $parameters default ''
  • param int $timeout default 0
public removeCSS(string $css) : static
 

Remove inline css

public removeHeadJavaScript(string $js) : static
 

Remove JavaScript from the header

public removeHeadScript(string $module) : PHPFUI\Interfaces\Page
 

Remove header script

  • param string $module path to script
public removeHeadTag(string $tag) : PHPFUI\Interfaces\Page
 

Remove a meta tag from the head section of the page

public removeIEComments(string $comment) : PHPFUI\Interfaces\Page
 

Remove IE commands.

public removeJavaScript(string $js) : PHPFUI\Interfaces\Page
 

Remove JavaScript from the page

public removeJavaScriptFirst(string $js) : PHPFUI\Interfaces\Page
 

Remove JavaScript from the first JavaScript before Foundation

public removeJavaScriptLast(string $js) : PHPFUI\Interfaces\Page
 

Remove JavaScript from the last JavaScript on the page

public removeStyleSheet(string $module) : PHPFUI\Interfaces\Page
 

Remove a Style Sheet from the page

  • param string $module filename
public removeTailScript(string $module) : PHPFUI\Interfaces\Page
 

Remove script from the end of the page

  • param string $module path to script
public static PHPFUI\Base::setDebug(int $level = 0) : void
 

Set the debug level, 1 or higher is on

public setFavIcon(string $path) : PHPFUI\Interfaces\Page
 

Sets the Fav Icon (shown in browser tabs and elsewhere in the browser)

  • param string $path to favicon
public setLanguage(string $lang) : PHPFUI\Interfaces\Page
 

Set the page language

public setPageName(string $name) : PHPFUI\Interfaces\Page
 

Set the page name. Defaults to "Created with Foundation"

  • param string $name of page
public PHPFUI\Base::setRawResponse(string $response, bool $asJSON = true) : static
 

Sets the page response directly and exits the program

  • return never|static
public setResourcePath(string $resourcePath = '/') : PHPFUI\Interfaces\Page
 

$resoursePath should start from the public root directory and include a trailing forward slash

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

Set a response in the standard format ('reponse' and 'color' array) exit will be called after returning the encoded response

  • param string $response to return
  • param string $color used for the save button
  • return never|static
public PHPFUI\Base::walk(string $method, ?mixed $argument = NULL) : static
 

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

  • param string $method to call on the object in the collection
  • param mixed $argument to pass to the method
Methods
protected getBody() : string
protected getEnd() : string
protected PHPFUI\Base::getItems() : array
 
  • return array
protected getStart() : string
Properties
private bool $android = false
private PHPFUI\Container $body
private bool $chrome = false
private array $css = []
 
  • var array<string,string>
private int $edgeVersion = 0
private string $favIcon = ''
private int $fireFoxVersion = 0
private array $headJavascript = []
 
  • var array<string,string>
private array $headScripts = []
 
  • var array<string,string>
private array $headTags = []
 
  • var array<string,string>
private array $ieComments = []
 
  • var array<string,string>
private bool $IEMobile = false
private bool $ios = false
private array $javascript = []
 
  • var array<string,string>
private array $javascriptFirst = []
 
  • var array<string,string>
private array $javascriptLast = []
 
  • var array<string,string>
private string $language = 'en'
private string $pageName = ''
private string $resourcePath = '/'
private array $scriptAttributes = []
 
  • var array<string,array<string,string>>
private array $styleSheets = []
 
  • var array<string,string>
private array $tailScripts = []
 
  • var array<string,string>
Methods
private getAttributes(array $attributes) : string
 
  • param array<string,string> $attributes
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

© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration