Unified two URL prefix variables into one

This commit is contained in:
Albert221 2016-01-12 22:07:47 +01:00
parent 17da649d0a
commit b123e435ff
3 changed files with 5 additions and 13 deletions

View File

@ -14,5 +14,8 @@ use Flarum\Http\AbstractUrlGenerator;
class UrlGenerator extends AbstractUrlGenerator class UrlGenerator extends AbstractUrlGenerator
{ {
/**
* {@inheritdoc}
*/
protected $path = 'admin'; protected $path = 'admin';
} }

View File

@ -17,5 +17,5 @@ class UrlGenerator extends AbstractUrlGenerator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $prefix = 'api'; protected $path = 'api';
} }

View File

@ -30,11 +30,6 @@ class AbstractUrlGenerator
*/ */
protected $path; protected $path;
/**
* @var string
*/
protected $prefix = '';
/** /**
* @param Application $app * @param Application $app
* @param RouteCollection $routes * @param RouteCollection $routes
@ -78,12 +73,6 @@ class AbstractUrlGenerator
*/ */
public function toBase() public function toBase()
{ {
$base = $this->app->url($this->path); return $this->app->url($this->path);
if (empty($this->prefix)) {
return $base;
} else {
return $base . '/' . $this->prefix;
}
} }
} }