* unecessary factory removed, layout / prefix had to be changed instead
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helper;
|
||||
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Zend\Diactoros\Uri;
|
||||
use Zend\Expressive\Helper\ServerUrlHelper;
|
||||
|
||||
class ServerUrlHelperFactory
|
||||
{
|
||||
/**
|
||||
* Create a UrlHelper instance.
|
||||
*
|
||||
* @param ContainerInterface $container
|
||||
* @return ServerUrlHelper
|
||||
* @throws \Psr\Container\ContainerExceptionInterface
|
||||
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||
*/
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$config = $container->get('config');
|
||||
$path = array_key_exists('los_basepath', $config) && !empty($config['los_basepath'])
|
||||
? $config['los_basepath']
|
||||
: null;
|
||||
|
||||
$serverUrlHelper = new ServerUrlHelper();
|
||||
if ($path) {
|
||||
$uri = (new Uri())->withPath($path);
|
||||
$serverUrlHelper->setUri($uri);
|
||||
}
|
||||
return $serverUrlHelper;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user