abstract class \mpf\interfaces\HtmlRequestInterface

abstract class \mpf\interfaces\HtmlRequestInterface

Inheritance -
Implements -
Uses \mpf\interfaces\LogAwareObjectInterface
Childs -
Available since version  0.1
Source Code https://github.com/mpf-soft/mpf/tree/master/interfaces/HtmlRequestInterface.php

-no description found-

Attributes
No attributes found for this class!
Methods

public abstract static \mpf\interfaces\HtmlRequestInterface get (mixed $options = [])

  • $options

    -no description found-

Must return instantiated component;

public abstract string getController ()

Get current controller name

public abstract string getAction ()

Get current action name

public abstract array getParams ()

Get an associative list of parameters and values;

public abstract string getModule ()

Get active module name;

public abstract mixed getModuleNamespace ()

Returns the active module namespace. If you need to use a module from a different package in config a "namespace" can be set for that module. If composer is not used then even a path can be specified. If not that path will be ignore and composer autoload is used.

public abstract string createURL (string $controller, string $action = null, array $params = [], string $module = null, string $language = null)

  • $controller

    Name of the controller where the URL must link

  • $action

    Name of the action where the URL must link

  • $params

    List of associative parameters

  • $module

    Name of the module where the URL must link. If none it's set it will use current module;

  • $language

    -no description found-

Get url to the selected page;

public abstract string getCurrentURL ()

Get full current URL;

public abstract null goToURL (mixed $url)

  • $url

    -no description found-

Redirect to selected string URL;

public abstract null goToPage (mixed $controller, mixed $action = null, mixed $params = [], mixed $module = null)

  • $controller

    -no description found-

  • $action

    -no description found-

  • $params

    -no description found-

  • $module

    -no description found-

Redirect to generated internal URL;

public abstract null reloadPage ()

Reload current page

public abstract null goBack ()

Go back to the last page

public abstract string getReferrer ()

Get URL referer. Similar to goBack(), but instead of redirect will return the address;

public abstract null simulateURI (mixed $uri)

  • $uri

    -no description found-

Will replace current HTML request with selected URI. This is used by HtmlRequest unit test.

public abstract mixed setController (string $name)

  • $name

    -no description found-

Change current controller.

public abstract mixed setAction (string $name)

  • $name

    -no description found-

Change current action.

public abstract string getWebRoot ()

Get html url for website root to be used to include images, scripts and other media elements

public abstract string getLinkRoot ()

Get html url for link root to be used to manually create links

public abstract bool isSecureConnection ()

Checks if website is accessed using a secure connection.

public abstract bool isPostRequest ()

Checks if this is a post request or not.

public abstract bool isPutRequest ()

Checks if this is a put request or not.

public abstract bool isDeleteRequest ()

Checks if this is a delete request or not.

public abstract bool isAjaxRequest ()

Checks if this is an ajax request or not.

public abstract string getPreferredLanguage ()

Get preferred language from client browser settings.

public abstract null sendFile (string $fileName, string $content, null $mimeType = null, bool $terminate = true)

  • $fileName

    -no description found-

  • $content

    -no description found-

  • $mimeType

    -no description found-

  • $terminate

    -no description found-

Send a file for download.

public abstract null xSendFile (string $filePath, array $options = [])

  • $filePath

    -no description found-

  • $options

    -no description found-

Send a file for download using more advanced options. Details on HTML request class.

public abstract string getUserAgent ()

Return visitor userAgent name.

public abstract string getCsrfKey ()

Get CSRF key name for POST requests.

public abstract string getCsrfValue ()

If is secured connection use CSRF for validation

public abstract mixed getDelete (mixed $name, null $defaultValue = null)

  • $name

    -no description found-

  • $defaultValue

    -no description found-

-no description found-

public abstract mixed getPut (mixed $name, null $defaultValue = null)

  • $name

    -no description found-

  • $defaultValue

    -no description found-

-no description found-

public abstract string getModulePath ()

Get full path for current module

public abstract mixed setModulePath (string $path)

  • $path

    -no description found-

Automatically called by WebApp class for modules outside app folder to set the correct path after the controller is loaded and address is known.

public abstract string getLanguage ()

Get User Selected Language

public abstract string getHost ()

Get current host