-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathModule.php
94 lines (89 loc) · 2.67 KB
/
Module.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* DkcwdZf2Munee is a ZF2 module which brings the joy of Cody Lundquist's asset optimisation
* library called 'munee' to ZF2 applications.
*
* It is easy to implement and provides access to the features of munee through 3 ZF2 view
* helpers, 1 custom route and 1 simple controller.
*
* View Helpers usage in view scripts
* ----------------------------------
*
* MuneeCss - used to generate a string which will call the custom route to handle css
* Example usage:
* echo $this->muneeCss(array(
* '/css/bootstrap-responsive.min.css',
* '/css/style.css',
* '/css/bootstrap.min.css'
* ),
* false // optional, if you do want the css to be minified then leave this param out
* );
*
* MuneeImg - used to generate a string which will call the custom route to handle images
* Example usage:
* echo $this->muneeImg(
* 'path-to-file.jpg',
* 'width[100]-height[50]',
* array('atributeKey' => 'attributeValue') // optional, the default is null
* );
*
* MuneeJs - used to generate a string which will call the custom route to handle js files
* Example usage:
* echo $this->muneeJs(array(
* '/scripts/myscript.js',
* '/scripts/myscript2.js',
* '/scripts/myscript3.js'
* ),
* false // optional, if you do want the js to be minified then leave this param out
* );
*
* @link http://github.com/dkcwd/dkcwd-zf2-munee for the canonical source repository
* @author Dave Clark dave@dkcwd.com.au
* @copyright (c) Dave Clark 2012 (https://www.dkcwd.com.au)
* @license http://opensource.org/licenses/mit-license.php
*/
namespace DkcwdZf2Munee;
/**
* Module class required for module to be initialized in ZF2 application
*/
class Module
{
/**
* Retrieve autoloader configuration for the module
*
* @return array
*/
public function getAutoloaderConfig()
{
return array('Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
));
}
/**
* Retrieve application configuration for this module
*
* @return array
*/
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
/**
* Register view helpers for this module
*
* @return array
*/
public function getViewHelperConfig()
{
$path = 'DkcwdZf2Munee\View\Helpers\\';
return array(
'invokables' => array(
'MuneeCss' => $path . 'MuneeCss',
'MuneeImg' => $path . 'MuneeImg',
'MuneeJs' => $path . 'MuneeJs',
),
);
}
}