private function registerBasicRoute($annotation, $controller, $controllerService, $reflectionClass, $reflectionMethod, $beforeFilters, $afterFilters)
    {
        $app = $this->app;

        if ($annotation->method != null || !empty($annotation->methods)) {
            $routeMethods = $annotation->method == null ? $annotation->methods : array($annotation->method);

            if ($annotation->pattern) {
                $container = $app;
                $ctr = $container->match($annotation->pattern, $controllerService.':'.$reflectionMethod->getName())->method(implode('|', $routeMethods));
            } else {

                $ctr = $controller->match($this->getRoutePattern($reflectionMethod), $controllerService.':'.$reflectionMethod->getName())->method(implode('|', $routeMethods));
            }

            if ($annotation->name != null) {
                $ctr->bind($annotation->name);
            } else {
                $ctr->bind($controllerService.'.'.strtolower($reflectionMethod->getName()));
            }

            if (!empty($beforeFilters)) {
                foreach ($beforeFilters->methods as $method) {
                    $this->registerFilter($method, 'before', $ctr, $controllerService, $reflectionClass);
                }
            }

            if (!empty($afterFilters)) {
                foreach ($afterFilters->methods as $method) {
                    $this->registerFilter($method, 'after', $ctr, $controllerService, $reflectionClass);
                }
            }

            $this->registerVariableHandlers($ctr, $controllerService, $reflectionMethod);
        } else {
            throw Exception::routeMethodNotDefinedError(sprintf(
                "O metodo '%s' do controlador '%s' foi anotado como rota mas nao possui um metodo (post,get,etc) definido",
                $reflectionMethod->getName(), $reflectionClass->getName()
            ));
        }
    }
private function registerBasicRoute($annotation, $controller, $controllerService, $reflectionClass, $reflectionMethod, $beforeFilters, $afterFilters)
    {
        $app = $this->app;

        if ($annotation->method != null || !empty($annotation->methods)) {
            $routeMethods = $annotation->method == null ? $annotation->methods : array($annotation->method);

            if ($annotation->pattern) {
                $container = $app;
                $ctr = $container->match($annotation->pattern, $controllerService.':'.$reflectionMethod->getName())->method(implode('|', $routeMethods));
            } else {

                $ctr = $controller->match($this->getRoutePattern($reflectionMethod), $controllerService.':'.$reflectionMethod->getName())->method(implode('|', $routeMethods));
            }

            if ($annotation->name != null) {
                $ctr->bind($annotation->name);
            } else {
                $ctr->bind($controllerService.'.'.strtolower($reflectionMethod->getName()));
            }

            if (!empty($beforeFilters)) {
                foreach ($beforeFilters->methods as $method) {
                    $this->registerFilter($method, 'before', $ctr, $controllerService, $reflectionClass);
                }
            }

            if (!empty($afterFilters)) {
                foreach ($afterFilters->methods as $method) {
                    $this->registerFilter($method, 'after', $ctr, $controllerService, $reflectionClass);
                }
            }

            $this->registerVariableHandlers($ctr, $controllerService, $reflectionMethod);
        } else {
            throw Exception::routeMethodNotDefinedError(sprintf(
                "O metodo '%s' do controlador '%s' foi anotado como rota mas nao possui um metodo (post,get,etc) definido",
                $reflectionMethod->getName(), $reflectionClass->getName()
            ));
        }
    }
private function registerBasicRoute ( $ annotation , $ controller , $ controllerService , $ reflectionClass , $ reflectionMethod , $ beforeFilters , $ afterFilters ) { $ app = $ this -> app ; if ( $ annotation -> method != null || ! empty ( $ annotation -> methods ) ) { $ routeMethods = $ annotation -> method == null ? $ annotation -> methods : array ( $ annotation -> method ) ; if ( $ annotation -> pattern ) { $ container = $ app ; $ ctr = $ container -> match ( $ annotation -> pattern , $ controllerService . ':' . $ reflectionMethod -> getName ( ) ) -> method ( implode ( '|' , $ routeMethods ) ) ; } else { $ ctr = $ controller -> match ( $ this -> getRoutePattern ( $ reflectionMethod ) , $ controllerService . ':' . $ reflectionMethod -> getName ( ) ) -> method ( implode ( '|' , $ routeMethods ) ) ; } if ( $ annotation -> name != null ) { $ ctr -> bind ( $ annotation -> name ) ; } else { $ ctr -> bind ( $ controllerService . '.' . strtolower ( $ reflectionMethod -> getName ( ) ) ) ; } if ( ! empty ( $ beforeFilters ) ) { foreach ( $ beforeFilters -> methods as $ method ) { $ this -> registerFilter ( $ method , 'before' , $ ctr , $ controllerService , $ reflectionClass ) ; } } if ( ! empty ( $ afterFilters ) ) { foreach ( $ afterFilters -> methods as $ method ) { $ this -> registerFilter ( $ method , 'after' , $ ctr , $ controllerService , $ reflectionClass ) ; } } $ this -> registerVariableHandlers ( $ ctr , $ controllerService , $ reflectionMethod ) ; } else { throw Exception :: routeMethodNotDefinedError ( sprintf ( "O metodo '%s' do controlador '%s' foi anotado como rota mas nao possui um metodo (post,get,etc) definido" , $ reflectionMethod -> getName ( ) , $ reflectionClass -> getName ( ) ) ) ; } }
Mapeia uma rota convencional em um controlador.

@param Route                       $annotation
@param \Silex\ControllerCollection $controller
@param string                      $controllerService
@param \ReflectionClass            $reflectionClass
@param \ReflectionMethod           $reflectionMethod
@param array                       $beforeFilters
@param array                       $afterFilters
Mapeia uma rota convencional em um controlador .