Skip to content
Permalink
Browse files

Don't populate Controller::$helpers in RequestHandler.

Since app/core helpers can be autoloaded with defaults upon use in templates
pre-populating Controller::$helpers is not required.
  • Loading branch information...
ADmad committed Dec 17, 2016
1 parent cc1e2b5 commit 07eb87d5ba40d31446b40d44f70e57af079595e8
@@ -594,15 +594,6 @@ public function renderAs(Controller $controller, $type, array $options = [])
if ($response->getMimeType($type)) {
$this->respondAs($type, $options);
}
$helper = ucfirst($type);
if (!in_array($helper, $controller->helpers) && empty($controller->helpers[$helper])) {
$helperClass = App::className($helper, 'View/Helper', 'Helper');
if ($helperClass !== false) {
$controller->helpers[] = $helper;
}
}
}
/**
@@ -627,9 +627,7 @@ public function testAjaxRedirectWithNoUrl()
*/
public function testRenderAs()
{
$this->assertFalse(in_array('Rss', $this->Controller->helpers));
$this->RequestHandler->renderAs($this->Controller, 'rss');
$this->assertTrue(in_array('Rss', $this->Controller->helpers));
$this->Controller->viewBuilder()->templatePath('request_handler_test\\rss');
$this->RequestHandler->renderAs($this->Controller, 'js');

0 comments on commit 07eb87d

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