Skip to content
Permalink
Browse files

Prevent RequestHandler to overwrite set view classes.

  • Loading branch information...
dereuromark committed Sep 25, 2015
1 parent 9c3f728 commit 7d10fb5fed70082fdd44c23f9e097a4a23aa29b5
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/Controller/Component/RequestHandlerComponent.php
@@ -164,8 +164,8 @@ protected function _setExtension($request, $response)
}
$accepts = $response->mapType($accept);
$preferedTypes = current($accepts);
if (array_intersect($preferedTypes, ['html', 'xhtml'])) {
$preferredTypes = current($accepts);
if (array_intersect($preferredTypes, ['html', 'xhtml'])) {
return;
}
@@ -546,7 +546,11 @@ public function renderAs(Controller $controller, $type, array $options = [])
} else {
$view = Inflector::classify($type);
}
$viewClass = App::className($view, 'View', 'View');
$viewClass = null;
if ($builder->className() === null) {
$viewClass = App::className($view, 'View', 'View');
}
if ($viewClass) {
$controller->viewClass = $viewClass;

0 comments on commit 7d10fb5

Please sign in to comment.
You can’t perform that action at this time.