Exemplo n.º 1
0
 /**
  * See if we can access this route
  * @return boolean
  */
 public function access()
 {
     if (empty($this->before)) {
         return true;
     }
     foreach ($this->before as $before) {
         if (is_callable($before) && !$before()) {
             return false;
         } elseif (!Routes::before($before)) {
             return false;
         }
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * Get route from string
  * @param string $part
  * @return Route
  */
 public function getRouteFromPart($part)
 {
     foreach (Routes::getRoutes() as $route) {
         if ($route->getUrl() == $part) {
             return $route;
         }
     }
     return NULL;
 }
Exemplo n.º 3
0
<?php

use Virge\Routes;
/**
 * 
 * @author Michael Kramer
 */
Routes::add('api', '\\Virge\\Api\\Controller\\ApiController', 'entry');