-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFC.php
More file actions
34 lines (26 loc) · 727 Bytes
/
FC.php
File metadata and controls
34 lines (26 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace BaseXMS;
/**
* @author pek
*
*
*/
class FC
{
static public function link( $link )
{
$services = $GLOBALS[ 'application' ]->getServiceLocator();
$basePath = $services->get( 'Request' )->getBasePath();
// add siteaccess context - I think I should as the siteaccess to build the link
$siteAccess = $GLOBALS[ 'application' ]->getRouteMatch()->getParam( 'context' );
$siteAccessUrlPart = $siteAccess ? '/:' . $siteAccess : '';
return $basePath . $siteAccessUrlPart . $link;
}
static public function assetLink( $link )
{
$services = $GLOBALS[ 'application' ]->getServiceLocator();
$basePath = $services->get( 'Request' )->getBasePath();
return $basePath . $link;
}
}
?>