Neos\Flow\Mvc\Routing\Router::setRoutesConfiguration PHP Method

setRoutesConfiguration() public method

Sets the routes configuration.
public setRoutesConfiguration ( array $routesConfiguration = null ) : void
$routesConfiguration array The routes configuration or NULL if it should be fetched from configuration
return void
    public function setRoutesConfiguration(array $routesConfiguration = null)
    {
        $this->routesConfiguration = $routesConfiguration;
        $this->routesCreated = false;
    }

Usage Example

Example #1
0
 /**
  * Set the routes configuration for the Neos setup and configures the routing component
  * to skip initialisation, which would overwrite the specific settings again.
  *
  * @param ComponentContext $componentContext
  * @return void
  */
 public function handle(ComponentContext $componentContext)
 {
     $configurationSource = $this->objectManager->get(\Neos\Flow\Configuration\Source\YamlSource::class);
     $routesConfiguration = $configurationSource->load($this->packageManager->getPackage('Neos.Setup')->getConfigurationPath() . ConfigurationManager::CONFIGURATION_TYPE_ROUTES);
     $this->router->setRoutesConfiguration($routesConfiguration);
     $componentContext->setParameter(\Neos\Flow\Mvc\Routing\RoutingComponent::class, 'skipRouterInitialization', true);
 }
All Usage Examples Of Neos\Flow\Mvc\Routing\Router::setRoutesConfiguration