methods example

->requirements(['id' => '\d+']);

        $routes->import('php_dsl_sub.php')
            ->namePrefix('z_')
            ->prefix('/zub');

        $routes->import('php_dsl_sub_root.php')
            ->prefix('/bus', false);

        $routes->add('ouf', '/ouf')
            ->schemes(['https'])
            ->methods(['GET'])
            ->defaults(['id' => 0]);
    }
};
yield new FrameworkBundle();
    }

    public function getProjectDir(): string
    {
        return __DIR__;
    }

    protected function configureRoutes(RoutingConfigurator $routes): void
    {
        $routes
            ->add('server_request', '/server-request')->controller([PsrRequestController::class, 'serverRequestAction'])->methods(['GET'])
            ->add('request', '/request')->controller([PsrRequestController::class, 'requestAction'])->methods(['POST'])
            ->add('message', '/message')->controller([PsrRequestController::class, 'messageAction'])->methods(['PUT'])
        ;
    }

    protected function configureContainer(ContainerConfigurator $container): void
    {
        $container->extension('framework', [
            'router' => ['utf8' => true],
            'secret' => 'for your eyes only',
            'test' => true,
            
<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes) {
    $collection = $routes->collection();
    $collection
        ->methods(['GET'])
        ->defaults(['attribute' => true])
        ->stateless();

    $collection->add('defaultsA', '/defaultsA')
        ->locale('en')
        ->format('html');

    $collection->add('defaultsB', '/defaultsB')
        ->methods(['POST'])
        ->stateless(false)
        ->locale('en')
        
->requirements(['id' => '\d+']);

    $routes->import('php_dsl_sub.php')
        ->namePrefix('z_')
        ->prefix('/zub');

    $routes->import('php_dsl_sub_root.php')
        ->prefix('/bus', false);

    $routes->add('ouf', '/ouf')
        ->schemes(['https'])
        ->methods(['GET'])
        ->defaults(['id' => 0]);
};
Home | Imprint | This part of the site doesn't use cookies.