Merge pull request #741 from Albert221/prefix-fix

UrlGenerator prefix fix.
This commit is contained in:
Toby Zerner 2016-01-13 08:17:10 +10:30
commit a4a1fa69b1
3 changed files with 5 additions and 13 deletions

View File

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

View File

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

View File

@ -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);
}
}