Exemplo n.º 1
0
 /**
  * Get the filters that are attached to the route for a given event.
  *
  * @param  string  $event
  * @return array
  */
 protected function filters($event)
 {
     $global = Bundle::prefix($this->bundle) . $event;
     $filters = array_unique(array($event, $global));
     // Next we will check to see if there are any filters attached to
     // the route for the given event. If there are, we'll merge them
     // in with the global filters for the event.
     if (isset($this->action[$event])) {
         $assigned = Filter::parse($this->action[$event]);
         $filters = array_merge($filters, $assigned);
     }
     // Next we will attach any pattern type filters to the array of
     // filters as these are matched to the route by the route's
     // URI and not explicitly attached to routes.
     if ($event == 'before') {
         $filters = array_merge($filters, $this->patterns());
     }
     return array(new Filter_Collection($filters));
 }
Exemplo n.º 2
0
 /**
  * Get the filters that are attached to the route for a given event.
  *
  * @param  string  $event
  * @return array
  */
 protected function filters($event)
 {
     $global = Bundle::prefix($this->bundle) . $event;
     $filters = array_unique(array($event, $global));
     // Next we will check to see if there are any filters attached to
     // the route for the given event. If there are, we'll merge them
     // in with the global filters for the event.
     if (isset($this->action[$event])) {
         $assigned = Filter::parse($this->action[$event]);
         $filters = array_merge($filters, $assigned);
     }
     return array(new Filter_Collection($filters));
 }
Exemplo n.º 3
0
 protected function filters($event)
 {
     $global = Bundle::prefix($this->bundle) . $event;
     $filters = array_unique(array($event, $global));
     if (isset($this->action[$event])) {
         $assigned = Filter::parse($this->action[$event]);
         $filters = array_merge($filters, $assigned);
     }
     if ($event == 'before') {
         $filters = array_merge($filters, $this->patterns());
     }
     return array(new Filter_Collection($filters));
 }
Exemplo n.º 4
0
 /**
  * Create a new filter collection instance.
  *
  * @param  string|array  $filters
  * @param  mixed         $parameters
  * @return void
  */
 public function __construct($filters, $parameters = null)
 {
     $this->parameters = $parameters;
     $this->filters = Filter::parse($filters);
 }
Exemplo n.º 5
0
 /**
  * Create a new filter collection instance.
  *
  * @param  string        $name
  * @param  string|array  $filters
  */
 public function __construct($name, $filters)
 {
     $this->name = $name;
     $this->filters = Filter::parse($filters);
 }