-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCCDNComponentCommonBundle.php
More file actions
59 lines (52 loc) · 1.5 KB
/
CCDNComponentCommonBundle.php
File metadata and controls
59 lines (52 loc) · 1.5 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/*
* This file is part of the CCDNComponent CommonBundle
*
* (c) CCDN (c) CodeConsortium <http://www.codeconsortium.com/>
*
* Available on github <http://www.github.com/codeconsortium/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CCDNComponent\CommonBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
*
* @category CCDNComponent
* @package CommonBundle
*
* @author Reece Fowell <reece@codeconsortium.com>
* @license http://opensource.org/licenses/MIT MIT
* @version Release: 2.0
* @link https://github.com/codeconsortium/CCDNComponentCommonBundle
*
*/
class CCDNComponentCommonBundle extends Bundle
{
/**
*
* @access public
*/
public function boot()
{
$route = $this->container->getParameter('ccdn_component_common.header.brand.route');
if (strlen($route) && $route != '#') {
$path = $this->container->get('router')->generate($route);
} else {
$path = '#';
}
$twig = $this->container->get('twig');
$twig->addGlobal(
'ccdn_component_common',
array(
'header' => array(
'brand' => array(
'route' => $path,
'label' => $this->container->getParameter('ccdn_component_common.header.brand.label'),
),
),
)
); // End Twig Globals.
}
}