1 | <?php |
||
26 | abstract class RoutesLoader implements LoaderInterface |
||
27 | { |
||
28 | /** |
||
29 | * Array which contains the |
||
30 | * routes configuration. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $config; |
||
35 | |||
36 | /** |
||
37 | * Boolean that checks if the |
||
38 | * routes are already loaded or not. |
||
39 | * |
||
40 | * @var bool |
||
41 | */ |
||
42 | protected $loaded; |
||
43 | |||
44 | /** |
||
45 | * Collection of routes. |
||
46 | * |
||
47 | * @var RouteCollection |
||
48 | */ |
||
49 | protected $routes; |
||
50 | |||
51 | /** |
||
52 | * Constructor. |
||
53 | * |
||
54 | * @param array $config Array which contains the routes configuration |
||
55 | */ |
||
56 | public function __construct(array $config = []) |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function load($resource, $type = null) |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function getResolver() |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function setResolver(LoaderResolverInterface $resolver) |
||
96 | |||
97 | /** |
||
98 | * Registers a new route inside route |
||
99 | * collection with the given params. |
||
100 | * |
||
101 | * @param string $file The file name |
||
102 | * @param array $config The user configuration array |
||
103 | */ |
||
104 | abstract protected function register($file, array $config); |
||
105 | } |
||
106 |