-
Notifications
You must be signed in to change notification settings - Fork 1
/
CartModule.php
50 lines (44 loc) · 875 Bytes
/
CartModule.php
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
<?php
/**
*
*
* All rights reserved.
*
* @author Falaleev Maxim
* @email max@studio107.ru
* @version 1.0
* @company Studio107
* @site http://studio107.ru
* @date 28/10/14.10.2014 13:05
*/
namespace Modules\Cart;
use Mindy\Base\Mindy;
use Mindy\Base\Module;
class CartModule extends Module
{
/**
* @var
*/
public $listRoute;
/**
* @var array
*/
public $cartConfig = [
'class' => '\Modules\Cart\Components\Cart',
];
public static function preConfigure()
{
$tpl = Mindy::app()->template;
$tpl->addHelper('cart', function() {
return Mindy::app()->getModule('Cart')->getCart();
});
}
public function init()
{
$this->setComponent('cart', $this->cartConfig);
}
public function getCart()
{
return $this->getComponent('cart');
}
}