Contao\Input::initialize PHP Method

initialize() public static method

Clean the global GPC arrays
public static initialize ( )
    public static function initialize()
    {
        $_GET = static::cleanKey($_GET);
        $_POST = static::cleanKey($_POST);
        $_COOKIE = static::cleanKey($_COOKIE);
    }

Usage Example

Example #1
0
 /**
  * Tests the getPost() method.
  *
  * @dataProvider postProvider
  */
 public function testGetPost($key, $input, $value, $expected)
 {
     $widget = $this->getMock('Contao\\Widget');
     $class = new \ReflectionClass('Contao\\Widget');
     $method = $class->getMethod('getPost');
     $method->setAccessible(true);
     $_POST[$input] = $value;
     Input::resetCache();
     Input::initialize();
     $this->assertEquals($expected, $method->invoke($widget, $key));
 }
All Usage Examples Of Contao\Input::initialize