public function prepare($url) { if (preg_match($this->_pattern, $url, $matches)) { $url = Template::compile($this->_template, ['id' => $matches['id']]); } return $url; }