/**
  * Constructor.
  *
  * Applies a default sf_method requirements of GET or HEAD.
  *
  * @see sfRoute
  */
 public function __construct($pattern, $defaults = array(), $requirements = array(), $options = array())
 {
     if (!isset($options['max_folder_depth'])) {
         $options['max_folder_depth'] = 10;
     }
     parent::__construct($pattern, $defaults, $requirements, $options);
 }
 /**
  * @see sfRequestRoute
  */
 public function __construct($pattern, array $defaults = array(), array $requirements = array(), array $options = array())
 {
     if ('/' != $pattern[0]) {
         list($host, $pattern) = explode('/', $pattern, 2);
         $options['host_route'] = $this->createHostRoute($host, $defaults, $requirements, $options);
     }
     parent::__construct($pattern, $defaults, $requirements, $options);
 }
Beispiel #3
0
 /**
  * Constructor.
  *
  * @param string $pattern       The pattern to match
  * @param array  $defaults      An array of default parameter values
  * @param array  $requirements  An array of requirements for parameters (regexes)
  * @param array  $options       An array of options
  *
  * @see sfRoute
  */
 public function __construct($pattern, array $defaults = array(), array $requirements = array(), array $options = array())
 {
     if (!isset($options['model'])) {
         throw new InvalidArgumentException(sprintf('You must pass a "model" option for a %s object (%s).', get_class($this), $pattern));
     }
     if (!isset($options['type'])) {
         throw new InvalidArgumentException(sprintf('You must pass a "type" option for a %s object (%s).', get_class($this), $pattern));
     }
     if (!in_array($options['type'], array('object', 'list'))) {
         throw new InvalidArgumentException(sprintf('The "type" option can only be "object" or "list", "%s" given (%s).', $options['type'], $pattern));
     }
     parent::__construct($pattern, $defaults, $requirements, $options);
 }