class \mpf\web\helpers\Html

class \mpf\web\helpers\Html

-no description found-

Attributes
public string $jqueryUITheme = "excite-bike"

Used by methods that require jQueryUI so that they will all load the same theme

private static array $cssScriptHistory = []

-no description found-

protected int $ajaxLinkCount = 1

-no description found-

Methods

public string css (string $text, string $media = "")

  • $text

    css text

  • $media

    -no description found-

Adds style tags to a css text.

public string script (mixed $script)

  • $script

    -no description found-

Register inline script. You can choose to insert a script only once and then if the same script is detected then it won't be inserted again.

public string mpfScriptFile (string $name)

  • $name

    -no description found-

-no description found-

public string scriptFile (mixed $path)

  • $path

    -no description found-

Returns a script tag that links to the specified file

public string mpfCssFile (string $name, string $media = "")

  • $name

    -no description found-

  • $media

    -no description found-

-no description found-

public string cssFile (mixed $path, string $media = "")

  • $path

    -no description found-

  • $media

    -no description found-

Returns a link tag to a css file.

public string encode (string $text)

  • $text

    -no description found-

Escapes a text for html.

public string decode (string $text)

  • $text

    -no description found-

Unescape a html text.

public array encodeArray (array $data)

  • $data

    -no description found-

Encodes an array of strings.

public string metaTag (string $content, null $name = null, null $httpEquiv = null, array $options = [])

  • $content

    -no description found-

  • $name

    -no description found-

  • $httpEquiv

    -no description found-

  • $options

    -no description found-

-no description found-

public string linkTag (string $relation = null, string $type = null, string $href = null, string $media = null, array $options = [])

  • $relation

    -no description found-

  • $type

    -no description found-

  • $href

    -no description found-

  • $media

    -no description found-

  • $options

    -no description found-

-no description found-

public string noContentElement (string $element, array $htmlOptions = [])

  • $element

    -no description found-

  • $htmlOptions

    element's html options like class, style, name or id..

Html::noContentElement()

Generates element that doesn't contain any text. Example:
,

public string tag (string $name, string $content, array $htmlOptions = [])

  • $name

    -no description found-

  • $content

    -no description found-

  • $htmlOptions

    -no description found-

Generates a HTML element with selected tag, content and options.

public string link (string $href, string $text, array $htmlOptions = [], bool $checkAccess = true)

  • $href

    -no description found-

  • $text

    -no description found-

  • $htmlOptions

    -no description found-

  • $checkAccess

    -no description found-

Returns a HTML link to selected URL.

public string image (string $url, string $title = "", array $htmlOptions = [])

  • $url

    -no description found-

  • $title

    -no description found-

  • $htmlOptions

    -no description found-

-no description found-

public string mpfImage (string $name, string $title = "", array $htmlOptions = [])

  • $name

    -no description found-

  • $title

    -no description found-

  • $htmlOptions

    -no description found-

-no description found-

public string postLink (string $url, string $text, array $postData = [], array $htmlOptions = [], bool $checkAccess = true, bool $confirm = false)

  • $url

    Url where form will be submitted

  • $text

    Visible text for the link

  • $postData

    List of hidden inputs that will be sent in form and the value for each.

  • $htmlOptions

    An associative list of htmloptions. Name and value.

  • $checkAccess

    If $url is array then it will check if it has access to that page and if not it will not display the link

  • $confirm

    Use confirmation message. Can be false or string with the message for confirmation

It creates a link and a hidden form. That form will be submitted where the link is setup as URL.

public string ajaxLink (string $url, string $text, string $callbackFunction, array $postData = [], array $htmlOptions = [], bool $checkAccess = true, bool $confirm = false)

  • $url

    -no description found-

  • $text

    -no description found-

  • $callbackFunction

    -no description found-

  • $postData

    -no description found-

  • $htmlOptions

    -no description found-

  • $checkAccess

    -no description found-

  • $confirm

    -no description found-

Generates a link that sends data using an ajax request to the selected url. On success it will call $callbackFunction and it will send 3 params: the received data, postData and clicked element.