Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 9, 2024 via composer

symfony/routing v2.8.50

Symfony Routing Component
Package summary
Share
0
issues
1
license
1
MIT
Package created
16 Oct 2011
Version published
20 Nov 2018
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
symfony/routing@v2.8.50
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of symfony/routing 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does symfony/routing do?

As an essential component of the renowned Symfony framework, the symfony/routing package associates an HTTP request with a set of configuration variables. This allows developers to handle routing for their PHP applications effectively. This feature enhances the flexibility of URL creation and supports generating URLs dynamically based on various parameters.

How do you use symfony/routing?

You can incorporate symfony/routing into your projects with a two-step process. First, install the package via Composer, the PHP package manager, with the command: $ composer require symfony/routing.

The subsequent code illustrates how to use the Routing component in a PHP application:

use App\Controller\BlogController;
use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;

$route = new Route('/blog/{slug}', ['_controller' => BlogController::class]);
$routes = new RouteCollection();
$routes->add('blog_show', $route);

$context = new RequestContext();

// Routing can match routes with incoming requests
$matcher = new UrlMatcher($routes, $context);
$parameters = $matcher->match('/blog/lorem-ipsum');
// $parameters = [
//     '_controller' => 'App\Controller\BlogController',
//     'slug' => 'lorem-ipsum',
//     '_route' => 'blog_show'
// ]

// Routing can also generate URLs for a given route
$generator = new UrlGenerator($routes, $context);
$url = $generator->generate('blog_show', [
    'slug' => 'my-blog-post',
]);
// $url = '/blog/my-blog-post'

As demonstrated, you can create a new route, add it to the route collection, and subsequently use the UrlMatcher and UrlGenerator instances to match incoming requests and generate URLs respectively.

Where are the symfony/routing docs?

Comprehensive documentation for symfony/routing can be accessed at https://symfony.com/doc/current/routing.html. The guide contains step-by-step instructions, code examples, and other useful information to help you understand and implement this routing functionality successfully. Take advantage of this resource to learn more about routing in the Symfony framework and ensure its effective use in meeting your application's specific requirements.