I was told that if I write a return in the controller, it will loop and cause an error on Codeigniter.
For example, is it inappropriate to write(return view) as follows in Controller?
public function example {
// ...
if (some conditions ...) {
return $this->twig->display('templates/error.html');
}
return $this->twig->display('templates/success.html');
}
I'm not familiar with Codeigniter.
I considered the return value to be a problem in Controller and corrected it as follows.
public function example {
// ...
if (some conditions ...) {
$this->twig->display('templates/error.html');
return;
}
$this->twig->display('templates/success.html');
return;
}
The older version of Codeigniter may also be affecting...
(Codeigniter 2.1.3 and PHP 5.3.3 and Twig 1.36.* )
Those who mention the location of the error are not sure about it.
Errors rarely occur(ERR_EMPTY_RESPONSE).
What I want to check is if there is no problem with the above-mentioned writing method in Controller.