namespace Acme\TestBundle\Controller;
use eZ\Bundle\EzPublishCoreBundle\Controller as BaseController;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class MyController extends BaseController
{
public function fooAction()
{
// ...
$location = $this->getRepository()->getLocationService()->loadLocation( 123 );
$locationUrl = $this->generateUrl(
$location,
array( 'siteaccess' => 'some_siteaccess_name' ),
UrlGeneratorInterface::ABSOLUTE_PATH
);
$regularRouteUrl = $this->generateUrl(
'some_route_name',
array( 'siteaccess' => 'some_siteaccess_name' ),
UrlGeneratorInterface::ABSOLUTE_PATH
);
// ...
}
} |