/**
  * @see sfRequestRoute
  */
 public function generate($params, $context = array(), $absolute = false)
 {
     if (!isset($this->options['host_route'])) {
         return parent::generate($params, $context, $absolute);
     }
     $hostParams = $this->extractHostParams($params);
     $protocol = isset($context['is_secure']) && $context['is_secure'] ? 'https' : 'http';
     $host = $this->options['host_route']->generate($hostParams, $context, false);
     $prefix = isset($context['prefix']) ? $context['prefix'] : '';
     $uri = parent::generate($params, $context, false);
     return $protocol . ':/' . $host . $prefix . $uri;
 }
Ejemplo n.º 2
0
 /**
  * Generates a URL from the given parameters.
  *
  * @param  mixed   $params    The parameter values
  * @param  array   $context   The context
  * @param  Boolean $absolute  Whether to generate an absolute URL
  *
  * @return string The generated URL
  */
 public function generate($params, $context = array(), $absolute = false)
 {
     return parent::generate('object' == $this->options['type'] ? $this->convertObjectToArray($params) : $params, $context, $absolute);
 }
 /**
  * Generates a URL from the given parameters.
  *
  * @param  mixed   $params    The parameter values
  * @param  array   $context   The context
  * @param  Boolean $absolute  Whether to generate an absolute URL
  *
  * @return string The generated URL
  */
 public function generate($params, $context = array(), $absolute = false)
 {
     return urldecode(parent::generate($this->convertObjectToArray($params), $context, $absolute));
 }
Ejemplo n.º 4
0
 public function generate($params, $context = array(), $absolute = false)
 {
     $params = array_merge(array('username' => $this->getUserId()), $params);
     return parent::generate($params, $context, $absolute);
 }