mirror of
https://github.com/flarum/core.git
synced 2025-06-27 21:24:50 +02:00
Merge pull request #741 from Albert221/prefix-fix
UrlGenerator prefix fix.
This commit is contained in:
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user