TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Form\Request Class Reference
Inheritance diagram for TYPO3\CMS\Form\Request:
TYPO3\CMS\Core\SingletonInterface tx_form_System_Request

Public Member Functions

 setPrefix ($prefix='tx_form')
 
 getPrefix ()
 
 setMethod ($method='get')
 
 getMethod ()
 
 get ($key)
 
 has ($key)
 
 hasRequest ()
 
 getQuery ($key=NULL, $default=NULL)
 
 getPost ($key=NULL, $default=NULL)
 
 getSession ($key=NULL, $default=NULL)
 
 getByMethod ($key=NULL, $default=NULL)
 
 storeSession ()
 
 destroySession ()
 
 storeFiles ()
 

Protected Member Functions

 removeFiles ()
 

Protected Attributes

 $prefix = 'tx_form'
 
 $method = 'post'
 
 $sessionData = array()
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Request Handler for Form

Author
Patrick Broens patri.nosp@m.ck@p.nosp@m.atric.nosp@m.kbro.nosp@m.ens.n.nosp@m.l

Definition at line 22 of file Request.php.

Member Function Documentation

◆ destroySession()

TYPO3\CMS\Form\Request::destroySession ( )

Destroy the session data for the form

Returns
void

Definition at line 258 of file Request.php.

References $GLOBALS, and TYPO3\CMS\Form\Request\removeFiles().

◆ get()

TYPO3\CMS\Form\Request::get (   $key)

Access values contained in the superglobals as public members POST and GET are filtered by prefix of the form Order of precedence: 1. GET, 2. POST, 3. COOKIE, 4. SERVER, 5. ENV

Parameters
string$keyParameter to look for
Returns
mixed

Definition at line 119 of file Request.php.

References TYPO3\CMS\Form\Request\$prefix.

◆ getByMethod()

TYPO3\CMS\Form\Request::getByMethod (   $key = NULL,
  $default = NULL 
)

Retrieve a member of the $_POST or $_GET superglobals or session data according to the used method.

If no $key is passed, it returns the entire method array within the prefix.

Parameters
string$keyThe member name
string$defaultDefault value if there is no $_POST, $_GET or session variable
Returns
mixed The member, or FALSE when wrong method is used

Definition at line 227 of file Request.php.

References TYPO3\CMS\Form\Request\getPost(), TYPO3\CMS\Form\Request\getQuery(), and TYPO3\CMS\Form\Request\getSession().

Referenced by TYPO3\CMS\Form\Request\removeFiles(), TYPO3\CMS\Form\Request\storeFiles(), and TYPO3\CMS\Form\Request\storeSession().

◆ getMethod()

TYPO3\CMS\Form\Request::getMethod ( )

Returns the method of this request handler

Returns
string

Definition at line 107 of file Request.php.

References TYPO3\CMS\Form\Request\$method.

Referenced by TYPO3\CMS\Form\Request\storeFiles().

◆ getPost()

TYPO3\CMS\Form\Request::getPost (   $key = NULL,
  $default = NULL 
)

Retrieve a member of the $_POST superglobal within the prefix

If no $key is passed, returns the entire $_POST array within the prefix.

Parameters
string$keyParameter to search for
mixed$defaultDefault value to use if key not found
Returns
mixed Returns NULL if key does not exist

Definition at line 194 of file Request.php.

References TYPO3\CMS\Form\Request\$prefix.

Referenced by TYPO3\CMS\Form\Request\getByMethod().

◆ getPrefix()

TYPO3\CMS\Form\Request::getPrefix ( )

Get the prefix

Returns
string

Definition at line 70 of file Request.php.

References TYPO3\CMS\Form\Request\$prefix.

◆ getQuery()

TYPO3\CMS\Form\Request::getQuery (   $key = NULL,
  $default = NULL 
)

Retrieve a member of the $_GET superglobal within the prefix

If no $key is passed, returns the entire $_GET array within the prefix.

Parameters
string$keyParameter to search for
mixed$defaultDefault value to use if key not found
Returns
mixed Returns NULL if key does not exist

Definition at line 178 of file Request.php.

References TYPO3\CMS\Form\Request\$prefix.

Referenced by TYPO3\CMS\Form\Request\getByMethod().

◆ getSession()

TYPO3\CMS\Form\Request::getSession (   $key = NULL,
  $default = NULL 
)

Retrieve a member of the $sessionData variable

If no $key is passed, returns the entire $sessionData array

Parameters
string$keyParameter to search for
mixed$defaultDefault value to use if key not found
Returns
mixed Returns NULL if key does not exist

Definition at line 210 of file Request.php.

References TYPO3\CMS\Form\Request\$sessionData.

Referenced by TYPO3\CMS\Form\Request\getByMethod().

◆ has()

TYPO3\CMS\Form\Request::has (   $key)

Check to see if a property is set

Parameters
string$keyParameter to look for
Returns
boolean

Definition at line 138 of file Request.php.

◆ hasRequest()

TYPO3\CMS\Form\Request::hasRequest ( )

Check to see if there is a request

Returns
boolean

Definition at line 156 of file Request.php.

◆ removeFiles()

TYPO3\CMS\Form\Request::removeFiles ( )
protected

Remove uploaded files from the typo3temp

Returns
void

Definition at line 329 of file Request.php.

References TYPO3\CMS\Form\Request\getByMethod(), and TYPO3\CMS\Core\Utility\GeneralUtility\unlink_tempfile().

Referenced by TYPO3\CMS\Form\Request\destroySession().

◆ setMethod()

TYPO3\CMS\Form\Request::setMethod (   $method = 'get')

Set the method used for submitting the data When used right it will only allow data send by the right method

Parameters
string$methodThe method
Returns
void

Definition at line 81 of file Request.php.

References $GLOBALS, and TYPO3\CMS\Form\Request\$method.

◆ setPrefix()

TYPO3\CMS\Form\Request::setPrefix (   $prefix = 'tx_form')

Set the prefix used in the form If prefix is available in configuration array of the object, it will take it from there. Otherwise if not given at all, it will set it to default

Parameters
string$prefixValue containing characters a-z, A-Z, 0-9, _ and -
Returns
void

Definition at line 57 of file Request.php.

References TYPO3\CMS\Form\Request\$prefix.

◆ storeFiles()

TYPO3\CMS\Form\Request::storeFiles ( )

◆ storeSession()

TYPO3\CMS\Form\Request::storeSession ( )

Store the form input in a session

Returns
void

Definition at line 244 of file Request.php.

References $GLOBALS, and TYPO3\CMS\Form\Request\getByMethod().

Member Data Documentation

◆ $method

TYPO3\CMS\Form\Request::$method = 'post'
protected

◆ $prefix

◆ $sessionData

TYPO3\CMS\Form\Request::$sessionData = array()
protected

Definition at line 47 of file Request.php.

Referenced by TYPO3\CMS\Form\Request\getSession().