fuel/core — Issue #743: Controller_Template $auto_render options has become useless
Author: jschreuder
Created: 2011-12-21 18:16:55+00:00
State: open

I got to this conclusion while updating the docs for this controller type. This is what the current `after()` method looks like:

public function after($response)
{
// If the response is a Response object, we don't want to create a new one
if ($this->auto_render === true and ! $response instanceof \Response)
{
$response = $this->response;
$response->body = $this->template;
}

return parent::after($response);
}

Which means that you can prevent "auto-render" without switching it off, all you have to do is return a Response object. I think we should get rid of the property and just do this:

public function after($response)
{
// If nothing was returned default to the template
if (empty($response))
{
$response = $this->template;
}

// If the response is a Response object, we don't want to create a new one
if ( ! $response instanceof Response)
{
$response = $this->response;
$response->body = $response;
}

return parent::after($response);
}