/**
  * Converts annotation into ZF2 route config item.
  * 
  * @param AnnotationInterface $annotation
  * @return array
  */
 protected function buildRouteFromAnnotation(AnnotationInterface $annotation)
 {
     return array('type' => $annotation->getType(), 'options' => array('route' => $annotation->getRoute(), 'defaults' => $annotation->getDefaults(), 'constraints' => $annotation->getConstraints()), 'may_terminate' => (bool) $annotation->getMayTerminate());
 }
 /**
  * @param AnnotationInterface $child
  * @return Route
  */
 public function addChild(AnnotationInterface $child)
 {
     // trim leading slash from child route if parent is root route (/).
     if ($this->route == '/') {
         $child->setRoute(ltrim($child->getRoute(), '/'));
     }
     $this->children[] = $child;
     return $this;
 }
示例#3
0
 /**
  * Converts annotation into ZF2 route config item.
  *
  * @param AnnotationInterface $annotation
  * @return array
  */
 protected function getRouteConfig(AnnotationInterface $annotation)
 {
     return array($annotation->getName() => array('type' => $annotation->getType(), 'options' => array('route' => $annotation->getRoute(), 'defaults' => $annotation->getDefaults(), 'constraints' => $annotation->getConstraints()), 'priority' => (int) $annotation->getPriority(), 'may_terminate' => (bool) $annotation->getMayTerminate(), 'child_routes' => array()));
 }