Neos\Flow\Mvc\Routing\UriBuilder::setCreateRelativePaths PHP 메소드

setCreateRelativePaths() 공개 메소드

By default relative URIs are prefixed with the current script request path creating absolute paths starting with a slash If this is set to FALSE, relative paths are created as it used to be the default behavior before Flow 2.0.
public setCreateRelativePaths ( boolean $createRelativePaths ) : UriBuilder
$createRelativePaths boolean
리턴 UriBuilder the current UriBuilder to allow method chaining
    public function setCreateRelativePaths($createRelativePaths)
    {
        $this->createRelativePaths = $createRelativePaths;
        return $this;
    }

Usage Example

 /**
  * @test
  */
 public function buildDoesNotPrependsScriptRequestPathIfCreateRelativePathsCompatibilityFlagIsTrue()
 {
     $this->mockHttpRequest->expects($this->never())->method('getScriptRequestPath');
     $this->mockRouter->expects($this->once())->method('resolve')->will($this->returnValue('resolvedUri'));
     $this->uriBuilder->setCreateAbsoluteUri(false);
     $this->uriBuilder->setCreateRelativePaths(true);
     $expectedResult = 'resolvedUri';
     $actualResult = $this->uriBuilder->build();
     $this->assertEquals($expectedResult, $actualResult);
 }