PHP Класс 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() { } }
Автор: Fabien Potencier ([email protected])
Наследование: implements Symfony\Component\Routing\Loader\LoaderInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$defaultRouteIndex
$reader
$routeAnnotationClass

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

__construct() публичный Метод

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

addRoute() защищенный Метод

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

configureRoute() абстрактный защищенный Метод

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

configureRoute() абстрактный защищенный Метод

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

getDefaultRouteName() защищенный Метод

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

getDefaultRouteName() защищенный Метод

Gets the default route name for a class method.
protected getDefaultRouteName ( ReflectionClass $class, ReflectionMethod $method ) : string
$class ReflectionClass
$method ReflectionMethod
Результат string

getResolver() публичный Метод

Gets the loader resolver.
public getResolver ( ) : Symfony\Component\Config\Loader\LoaderResolver
Результат Symfony\Component\Config\Loader\LoaderResolver A LoaderResolver instance

getResolver() публичный Метод

Gets the loader resolver.
public getResolver ( ) : LoaderResolver
Результат LoaderResolver A LoaderResolver instance

load() публичный Метод

Loads from annotations from a class.
public load ( string $class ) : RouteCollection
$class string A class name
Результат Symfony\Component\Routing\RouteCollection A RouteCollection instance

load() публичный Метод

Loads from annotations from a class.
public load ( string $class, string $type = null ) : RouteCollection
$class string A class name
$type string The resource type
Результат Symfony\Component\Routing\RouteCollection A RouteCollection instance

setResolver() публичный Метод

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

setResolver() публичный Метод

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

setRouteAnnotationClass() публичный Метод

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

supports() публичный Метод

Returns true if this class supports the given resource.
public supports ( mixed $resource ) : boolean
$resource mixed A resource
Результат boolean true if this class supports the given resource, false otherwise

supports() публичный Метод

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
Результат boolean True if this class supports the given resource, false otherwise

Описание свойств

$defaultRouteIndex защищенное свойство

protected $defaultRouteIndex

$reader защищенное свойство

protected $reader

$routeAnnotationClass защищенное свойство

protected $routeAnnotationClass