@@ 112-123 (lines=12) @@ | ||
109 | } |
|
110 | ||
111 | // Model |
|
112 | if ($modelNamespace !== null) { |
|
113 | $modelClassPath = $modelNamespace . "\\" . $modelClassName; |
|
114 | $this->coreContainer->model = function () use ($container, $classLoader, $modelClassPath, $modelClassName) { |
|
115 | if ($classLoader->import($container->applicationInfo->applicationDir . "/models/" . $modelClassName . ".php")) { |
|
116 | return new $modelClassPath($container); |
|
117 | } |
|
118 | }; |
|
119 | } else { |
|
120 | $classpath = "\WebStream\Exception\Extend\ClassNotFoundException"; |
|
121 | $message = $pageName . "Service and " . $pageName . "Model is not defined."; |
|
122 | $this->coreContainer->model = new CoreExceptionDelegator($classpath, $message); |
|
123 | } |
|
124 | ||
125 | // Helper |
|
126 | if ($helperNamespace !== null) { |
|
@@ 126-137 (lines=12) @@ | ||
123 | } |
|
124 | ||
125 | // Helper |
|
126 | if ($helperNamespace !== null) { |
|
127 | $helperClassPath = $helperNamespace . "\\" . $helperClassName; |
|
128 | $this->coreContainer->helper = function () use ($container, $classLoader, $helperClassPath, $helperClassName) { |
|
129 | if ($classLoader->import($container->applicationInfo->applicationDir . "/helpers/" . $helperClassName . ".php")) { |
|
130 | return new $helperClassPath($container); |
|
131 | } |
|
132 | }; |
|
133 | } else { |
|
134 | $classpath = "\WebStream\Exception\Extend\ClassNotFoundException"; |
|
135 | $message = $pageName . "Helper is not defined."; |
|
136 | $this->coreContainer->helper = new CoreExceptionDelegator($classpath, $message); |
|
137 | } |
|
138 | } |
|
139 | ||
140 | /** |