mirror of
https://github.com/flarum/framework.git
synced 2024-11-24 17:12:13 +08:00
Unified two URL prefix variables into one
This commit is contained in:
parent
17da649d0a
commit
b123e435ff
|
@ -14,5 +14,8 @@ use Flarum\Http\AbstractUrlGenerator;
|
|||
|
||||
class UrlGenerator extends AbstractUrlGenerator
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $path = 'admin';
|
||||
}
|
||||
|
|
|
@ -17,5 +17,5 @@ class UrlGenerator extends AbstractUrlGenerator
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $prefix = 'api';
|
||||
protected $path = 'api';
|
||||
}
|
||||
|
|
|
@ -30,11 +30,6 @@ class AbstractUrlGenerator
|
|||
*/
|
||||
protected $path;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = '';
|
||||
|
||||
/**
|
||||
* @param Application $app
|
||||
* @param RouteCollection $routes
|
||||
|
@ -78,12 +73,6 @@ class AbstractUrlGenerator
|
|||
*/
|
||||
public function toBase()
|
||||
{
|
||||
$base = $this->app->url($this->path);
|
||||
|
||||
if (empty($this->prefix)) {
|
||||
return $base;
|
||||
} else {
|
||||
return $base . '/' . $this->prefix;
|
||||
}
|
||||
return $this->app->url($this->path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user