@@ 227-251 (lines=25) @@ | ||
224 | * |
|
225 | * @return array |
|
226 | */ |
|
227 | protected function getPreviewRouteParameters() |
|
228 | { |
|
229 | $previewPath = sprintf('/%s/preview/{url}', $this->adminKey); |
|
230 | $previewDefaults = array( |
|
231 | '_controller' => SlugController::class.'::slugAction', |
|
232 | 'preview' => true, |
|
233 | 'url' => '', |
|
234 | '_locale' => $this->getDefaultLocale(), |
|
235 | ); |
|
236 | $previewRequirements = array( |
|
237 | 'url' => $this->getSlugPattern(), |
|
238 | ); |
|
239 | ||
240 | if ($this->isMultiLanguage()) { |
|
241 | $previewPath = '/{_locale}' . $previewPath; |
|
242 | unset($previewDefaults['_locale']); |
|
243 | $previewRequirements['_locale'] = $this->getEscapedLocales($this->getBackendLocales()); |
|
244 | } |
|
245 | ||
246 | return array( |
|
247 | 'path' => $previewPath, |
|
248 | 'defaults' => $previewDefaults, |
|
249 | 'requirements' => $previewRequirements, |
|
250 | ); |
|
251 | } |
|
252 | ||
253 | /** |
|
254 | * Return slug route parameters |
|
@@ 258-282 (lines=25) @@ | ||
255 | * |
|
256 | * @return array |
|
257 | */ |
|
258 | protected function getSlugRouteParameters() |
|
259 | { |
|
260 | $slugPath = '/{url}'; |
|
261 | $slugDefaults = array( |
|
262 | '_controller' => SlugController::class.'::slugAction', |
|
263 | 'preview' => false, |
|
264 | 'url' => '', |
|
265 | '_locale' => $this->getDefaultLocale(), |
|
266 | ); |
|
267 | $slugRequirements = array( |
|
268 | 'url' => $this->getSlugPattern(), |
|
269 | ); |
|
270 | ||
271 | if ($this->isMultiLanguage()) { |
|
272 | $slugPath = '/{_locale}' . $slugPath; |
|
273 | unset($slugDefaults['_locale']); |
|
274 | $slugRequirements['_locale'] = $this->getEscapedLocales($this->getFrontendLocales()); |
|
275 | } |
|
276 | ||
277 | return array( |
|
278 | 'path' => $slugPath, |
|
279 | 'defaults' => $slugDefaults, |
|
280 | 'requirements' => $slugRequirements, |
|
281 | ); |
|
282 | } |
|
283 | ||
284 | /** |
|
285 | * @return bool |