PHP Class Symfony\Component\Routing\Loader\AnnotationClassLoader

You need to define an implementation for the getRouteDefaults() method. Most of the time, this method should define some PHP callable to be called for the route (a controller in MVC speak). The @Route annotation can be set on the class (for global parameters), and on each method. The @Route annotation main value is the route pattern. The annotation also recognizes three parameters: requirements, options, and name. The name parameter is mandatory. Here is an example of how you should be able to use it: ** * @Route("/Blog") * / class Blog { ** * @Route("/", name="blog_index") * / public function index() { } ** * @Route("/:id", name="blog_post", requirements = {"id" = "\d+"}) * / public function show() { } }
Author: Fabien Potencier ([email protected])
Inheritance: implements Symfony\Component\Routing\Loader\LoaderInterface
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Свойство Type Description
$defaultRouteIndex
$reader
$routeAnnotationClass

Méthodes publiques

Méthode Description
__construct ( AnnotationReader $reader ) Constructor.
__construct ( Doctrine\Common\Annotations\Reader $reader ) Constructor.
getResolver ( ) : Symfony\Component\Config\Loader\LoaderResolver Gets the loader resolver.
getResolver ( ) : LoaderResolver Gets the loader resolver.
load ( string $class ) : RouteCollection Loads from annotations from a class.
load ( string $class, string $type = null ) : RouteCollection Loads from annotations from a class.
setResolver ( Symfony\Component\Config\Loader\LoaderResolver $resolver ) Sets the loader resolver.
setResolver ( LoaderResolver $resolver ) Sets the loader resolver.
setRouteAnnotationClass ( string $class ) Sets the annotation class to read route properties from.
supports ( mixed $resource ) : boolean Returns true if this class supports the given resource.
supports ( mixed $resource, string $type = null ) : boolean Returns true if this class supports the given resource.

Méthodes protégées

Méthode Description
addRoute ( RouteCollection $collection, $annot, $globals, ReflectionClass $class, ReflectionMethod $method )
configureRoute ( Symfony\Component\Routing\Route $route, ReflectionClass $class, ReflectionMethod $method )
configureRoute ( Symfony\Component\Routing\Route $route, ReflectionClass $class, ReflectionMethod $method, $annot )
getDefaultRouteName ( ReflectionClass $class, ReflectionMethod $method )
getDefaultRouteName ( ReflectionClass $class, ReflectionMethod $method ) : string Gets the default route name for a class method.

Method Details

__construct() public méthode

Constructor.
public __construct ( AnnotationReader $reader )
$reader Doctrine\Common\Annotations\AnnotationReader

__construct() public méthode

Constructor.
public __construct ( Doctrine\Common\Annotations\Reader $reader )
$reader Doctrine\Common\Annotations\Reader

addRoute() protected méthode

protected addRoute ( RouteCollection $collection, $annot, $globals, ReflectionClass $class, ReflectionMethod $method )
$collection Symfony\Component\Routing\RouteCollection
$class ReflectionClass
$method ReflectionMethod

configureRoute() abstract protected méthode

abstract protected configureRoute ( Symfony\Component\Routing\Route $route, ReflectionClass $class, ReflectionMethod $method )
$route Symfony\Component\Routing\Route
$class ReflectionClass
$method ReflectionMethod

configureRoute() abstract protected méthode

abstract protected configureRoute ( Symfony\Component\Routing\Route $route, ReflectionClass $class, ReflectionMethod $method, $annot )
$route Symfony\Component\Routing\Route
$class ReflectionClass
$method ReflectionMethod

getDefaultRouteName() protected méthode

protected getDefaultRouteName ( ReflectionClass $class, ReflectionMethod $method )
$class ReflectionClass
$method ReflectionMethod

getDefaultRouteName() protected méthode

Gets the default route name for a class method.
protected getDefaultRouteName ( ReflectionClass $class, ReflectionMethod $method ) : string
$class ReflectionClass
$method ReflectionMethod
Résultat string

getResolver() public méthode

Gets the loader resolver.
public getResolver ( ) : Symfony\Component\Config\Loader\LoaderResolver
Résultat Symfony\Component\Config\Loader\LoaderResolver A LoaderResolver instance

getResolver() public méthode

Gets the loader resolver.
public getResolver ( ) : LoaderResolver
Résultat LoaderResolver A LoaderResolver instance

load() public méthode

Loads from annotations from a class.
public load ( string $class ) : RouteCollection
$class string A class name
Résultat Symfony\Component\Routing\RouteCollection A RouteCollection instance

load() public méthode

Loads from annotations from a class.
public load ( string $class, string $type = null ) : RouteCollection
$class string A class name
$type string The resource type
Résultat Symfony\Component\Routing\RouteCollection A RouteCollection instance

setResolver() public méthode

Sets the loader resolver.
public setResolver ( Symfony\Component\Config\Loader\LoaderResolver $resolver )
$resolver Symfony\Component\Config\Loader\LoaderResolver A LoaderResolver instance

setResolver() public méthode

Sets the loader resolver.
public setResolver ( LoaderResolver $resolver )
$resolver LoaderResolver A LoaderResolver instance

setRouteAnnotationClass() public méthode

Sets the annotation class to read route properties from.
public setRouteAnnotationClass ( string $class )
$class string A fully-qualified class name

supports() public méthode

Returns true if this class supports the given resource.
public supports ( mixed $resource ) : boolean
$resource mixed A resource
Résultat boolean true if this class supports the given resource, false otherwise

supports() public méthode

Returns true if this class supports the given resource.
public supports ( mixed $resource, string $type = null ) : boolean
$resource mixed A resource
$type string The resource type
Résultat boolean True if this class supports the given resource, false otherwise

Property Details

$defaultRouteIndex protected_oe property

protected $defaultRouteIndex

$reader protected_oe property

protected $reader

$routeAnnotationClass protected_oe property

protected $routeAnnotationClass