mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 11:34:36 +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
|
class UrlGenerator extends AbstractUrlGenerator
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
protected $path = 'admin';
|
protected $path = 'admin';
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,5 +17,5 @@ class UrlGenerator extends AbstractUrlGenerator
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $prefix = 'api';
|
protected $path = 'api';
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user