RequestEngine
Request engine
The Request Engine helps handling GET variables and referers as well as creating links and redirection. It also handles session ID propagation when the client doesn't accept cookies.
Located in /libraries/RequestEngine.class.php (line 17)
Class | Description |
---|---|
RequestEngineMVC | RequestEngine designed for MVC framework |
Use this methode to retrieve a reference on the request object from anywhere in the code
- RequestEngineMVC::getInstance() : Gets the instance
Returns an URL with the request parameters specified as method arguments
- string $absoluteLink: The absolute URL
Returns an URL containing all the currently defined GET parameters
Example:
- // Current page: http://url/index.php?toto=a&foo=bar
- string $file: The filename
- boolean $relativePath: Whether the first parameter is a relative URL (default: true). Set this parameter to false if you want to create and external link.
- RequestEngineMVC::createLink() : Creates a link to the specified route with all defined GET vars in the URL
Returns an URL with the request parameters specified as method arguments (eg. )
Example:
- // Current page: http://url/index.php?toto=a&foo=bar&bla=bla
- $request->createLinkArgList("page.php", "toto", "bla"); // Returns http://url/page.php?toto=a&bla=bla
- string $file: The filename (eg: "index.php" or "admin/login.php")
- RequestEngineMVC::createLinkArgList() : Creates a link to the specified route with, with names of GET vars as parameters of the method
Retrieves a GET parameter, or the default value if not found
- string $name
- mixed $default
Returns the referer, or the specified default page, or index.php
- string $default
Retrieves a GET parameter, or throws an exception if not found or null
- string $name
- string $message: Optional human readable name for error dialog
Creates a Manialink redirection to the specified file with GET parameters specified as method arguments.
Example:
- string $file: The filename of the link target
- RequestEngineMVC::redirectManialink() : Redirects to the specified route with all defined GET vars in the URL
Creates a Manialink redirection to the specified absolute URI
- string $absoluteUri
Creates a Manialink redirection to the previously registered referer, or
the index if no referer was previously registered
Registers the "$name" parameter as protected parameters. Global parameters atr always removed from the parameter array and saved as a session parameter when the page is loaded.
- string $name
Registers the '$name' parameter as protected parameters. Protected parameters are always removed from the parameter array when the page is loaded.
- string $name
Restores a GET parameter to the value it had when the page was loaded
- string $name