Prado\Web\THttpRequest::setUrlParamSeparator PHP Method

setUrlParamSeparator() public method

public setUrlParamSeparator ( $value )
    public function setUrlParamSeparator($value)
    {
        if (strlen($value) === 1) {
            $this->_separator = $value;
        } else {
            throw new TInvalidDataValueException('httprequest_separator_invalid');
        }
    }

Usage Example

Example #1
0
 public function testGetSetUrlParamSeparator()
 {
     $request = new THttpRequest();
     $request->init(null);
     // Try an invalid separator
     try {
         $request->setUrlParamSeparator('&&');
         self::fail('httprequest_separator_invalid exception not thrown');
     } catch (TInvalidDataValueException $e) {
     }
     // Try valid one
     $request->setUrlParamSeparator('&');
     self::assertEquals('&', $request->getUrlParamSeparator());
 }