src/EcommerceBundle/PageBundle/DependencyInjection/EcommerceBundleSonataPageExtension.php
/**
     * Configure the page default settings.
     *
     * @param ContainerBuilder $container Container builder
     * @param array            $config    Array of configuration
     */
Configure the page default settings.
@param ContainerBuilder $container Container builder
@param array            $config    Array of configuration
Configure the page default settings . @param ContainerBuilder $container Container builder @param array $config Array of configuration
public function configurePageDefaults(ContainerBuilder $container, array $config)
    {
        $defaults = [
            'templateCode' => $config['default_template'],
            'enabled' => true,
            'routeName' => null,
            'name' => null,
            'slug' => null,
            'url' => null,
            'requestMethod' => null,
            'decorate' => true,
        ];
        $container->getDefinition('sonata.page.manager.page')
            ->replaceArgument(2, $defaults);
        foreach ($config['page_defaults'] as $name => $pageDefaults) {
            $config['page_defaults'][$name] = array_merge($defaults, $pageDefaults);
        }
        $container->getDefinition('sonata.page.manager.page')
            ->replaceArgument(3, $config['page_defaults']);
    }
public function configurePageDefaults ( ContainerBuilder $ container , array $ config ) { $ defaults = [ 'templateCode' => $ config [ 'default_template' ] , 'enabled' => true , 'routeName' => null , 'name' => null , 'slug' => null , 'url' => null , 'requestMethod' => null , 'decorate' => true , ] ; $ container -> getDefinition ( 'sonata.page.manager.page' ) -> replaceArgument ( 2 , $ defaults ) ; foreach ( $ config [ 'page_defaults' ] as $ name => $ pageDefaults ) { $ config [ 'page_defaults' ] [ $ name ] = array_merge ( $ defaults , $ pageDefaults ) ; } $ container -> getDefinition ( 'sonata.page.manager.page' ) -> replaceArgument ( 3 , $ config [ 'page_defaults' ] ) ; }
Configure the page default settings.
Configure the page default settings .