src/DependencyInjection/SonataPageExtension.php
/**
     * Configures the page custom exceptions.
     *
     * @param ContainerBuilder $container Container builder
     * @param array            $config    An array of bundle configuration
     */
Configures the page custom exceptions.
@param ContainerBuilder $container Container builder
@param array            $config    An array of bundle configuration
Configures the page custom exceptions . @param ContainerBuilder $container Container builder @param array $config An array of bundle configuration
public function configureExceptions(ContainerBuilder $container, array $config)
    {
        $exceptions = [];
        foreach ($config['catch_exceptions'] as $keyWord => $codes) {
            foreach ($codes as $code) {
                $exceptions[$code] = sprintf('_page_internal_error_%s', $keyWord);
            }
        }
        $container->getDefinition('sonata.page.kernel.exception_listener')
            ->replaceArgument(6, $exceptions);
        $container->getDefinition('sonata.page.template_manager')
            ->replaceArgument(1, ['error_codes' => $exceptions]);
    }
public function configureExceptions ( ContainerBuilder $ container , array $ config ) { $ exceptions = [ ] ; foreach ( $ config [ 'catch_exceptions' ] as $ keyWord => $ codes ) { foreach ( $ codes as $ code ) { $ exceptions [ $ code ] = sprintf ( '_page_internal_error_%s' , $ keyWord ) ; } } $ container -> getDefinition ( 'sonata.page.kernel.exception_listener' ) -> replaceArgument ( 6 , $ exceptions ) ; $ container -> getDefinition ( 'sonata.page.template_manager' ) -> replaceArgument ( 1 , [ 'error_codes' => $ exceptions ] ) ; }
Configures the page custom exceptions.
Configures the page custom exceptions .
// add exception pages in exception_listener // add exception pages as default rendering parameters in page templates