コード例 #1
0
ファイル: SegmentRoute.php プロジェクト: rakorium/okapi
 /**
  * @param Destination $destination
  * @param Uri $context
  * @return Uri
  */
 public function assemble(Destination $destination, $context = null)
 {
     $base = Uri::cast($context);
     $params = $destination->getParams();
     $path = $this->resolvePattern($params->core());
     $uri = new Uri();
     $uri->setPath($base->getPath() . $path);
     return $uri;
 }
コード例 #2
0
ファイル: RegexRoute.php プロジェクト: rakorium/okapi
 /**
  * @param Destination $destination
  * @param Uri $context
  */
 public function assemble(Destination $destination, $context = null)
 {
     $base = Uri::cast($context);
     $model = clone $destination->getParams();
     $model->set('~', $base->getPath());
     $path = $model->render($this->getTemplate());
     $uri = new Uri();
     $uri->setPath($path);
     return $uri;
 }