prefix example

/* test case 13 */
        $hostCollection = new RouteCollection();
        $hostCollection->add('r1', (new Route('abc{foo}'))->setHost('{foo}.exampple.com'));
        $hostCollection->add('r2', (new Route('abc{foo}'))->setHost('{foo}.exampple.com'));

        /* test case 14 */
        $fixedLocaleCollection = new RouteCollection();
        $routes = new RoutingConfigurator($fixedLocaleCollectionnew PhpFileLoader(new FileLocator()), __FILE__, __FILE__);
        $routes
            ->collection()
            ->prefix('/{_locale}')
            ->add('home', [
                'fr' => 'accueil',
                'en' => 'home',
            ])
        ;

        return [
            [new RouteCollection(), 'compiled_url_matcher0.php'],
            [$collection, 'compiled_url_matcher1.php'],
            [$redirectCollection, 'compiled_url_matcher2.php'],
            [$rootprefixCollection, 'compiled_url_matcher3.php'],
            [
'order_transaction.state.reminded',
            'order.state.cancelled',
            'order.state.completed',
            'order.state.in_progress',
            // order.state.open is removed, this state is handled by 'checkout.order.placed'         ]);

        // fetch order state mails         $states = $this->fetchMails($connection$ids);

        // add prefix for state event         $states = $this->prefix($states, 'state_enter.');

        $this->insertMails($connection$states);
    }

    public function updateDestructive(Connection $connection): void
    {
    }

    /** * @param list<string> $ids * * @return array<string, array<string, string>> */
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes): void {
    $routes
        ->import(
            resource: [
                'path' => './Psr4Controllers',
                'namespace' => 'Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers',
            ],
            type: 'attribute',
        )
        ->prefix('/my-prefix');
};

namespace Symfony\Component\Routing\Loader\Configurator;

use Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers\MyController;

return function DRoutingConfigurator $routes): void {
    $routes
        ->import(
            resource: MyController::class,
            type: 'attribute',
        )
        ->prefix('/my-prefix');
};
<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes) {
    $routes->import('imported-with-defaults.php')
        ->prefix('/defaults')
        ->locale('g_locale')
        ->format('g_format')
        ->stateless(true)
    ;
};
<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes) {
    $routes->import('imported.php')->host([
        'nl' => 'www.example.nl',
        'en' => 'www.example.com',
    ])->prefix([
        'nl' => '/nl',
        'en' => '/en',
    ]);
};
<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes) {
    $add = $routes->collection('c_')
        ->prefix('pub');

    $add('foo', ['fr' => '/foo']);
    $add('bar', ['fr' => '/bar']);

    $routes->add('non_localized', '/non-localized');
};
<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes) {
    $add = $routes->collection('c_')
        ->prefix('pub');

    $add('root', '/');
    $add('bar', '/bar');

    $add->collection('pub_')
        ->host('host')
        ->add('buz', 'buz');
};
<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes) {
    $routes
        ->collection()
        ->prefix(['en' => '/glish'])
        ->add('foo', '/foo')
        ->add('bar', ['en' => '/bar']);

    $routes
        ->add('baz', ['en' => '/baz']);

    $routes->import('php_dsl_sub_i18n.php')
        ->prefix(['fr' => '/ench']);
};
namespace Symfony\Component\Routing\Loader\Configurator;

return function DRoutingConfigurator $routes): void {
    $routes
        ->import(
            resource: [
                'path' => '../Psr4Controllers',
                'namespace' => 'Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers',
            ],
            type: 'attribute',
        )
        ->prefix('/my-prefix');
};
public function registerBundles(): iterable
    {
        return [
            new FrameworkBundle(),
            new TwigBundle(),
            new WebProfilerBundle(),
        ];
    }

    protected function configureRoutes(RoutingConfigurator $routes): void
    {
        $routes->import(__DIR__.'/../../Resources/config/routing/profiler.xml')->prefix('/_profiler');
        $routes->import(__DIR__.'/../../Resources/config/routing/wdt.xml')->prefix('/_wdt');
        $routes->add('_', '/')->controller('kernel::homepageController');
    }

    protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
    {
        $config = [
            'annotations' => false,
            'http_method_override' => false,
            'php_errors' => ['log' => true],
            'secret' => 'foo-secret',
            
->collection()
        ->add('foo', '/foo')
            ->condition('abc')
            ->options(['utf8' => true])
        ->add('buz', 'zub')
            ->controller('foo:act')
            ->stateless(true)
        ->add('controller_class', '/controller')
            ->controller(['Acme\MyApp\MyController', 'myAction']);

    $routes->import('php_dsl_sub.php')
        ->prefix('/sub')
        ->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'])
        
->collection()
            ->add('foo', '/foo')
            ->condition('abc')
            ->options(['utf8' => true])
            ->add('buz', 'zub')
            ->controller('foo:act')
            ->stateless(true)
            ->add('controller_class', '/controller')
            ->controller(['Acme\MyApp\MyController', 'myAction']);

        $routes->import('php_dsl_sub.php')
            ->prefix('/sub')
            ->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'])
            
Home | Imprint | This part of the site doesn't use cookies.