for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ffcms\Core\Network;
use Ffcms\Core\App;
use Ffcms\Core\Helper\Type\Str;
use Symfony\Component\HttpFoundation\RedirectResponse as FoundationRedirect;
use Symfony\Component\HttpFoundation\Response as FoundationResponse;
/**
* Class Response. Basic implementation of httpfoundation.response class.
* @package Ffcms\Core\Network
*/
class Response extends FoundationResponse
{
* Fast redirect in web environment
* @param string $to
* @param bool $full
public function redirect($to, $full = false)
$to = trim($to, '/');
if (!$full && !Str::startsWith(App::$Alias->baseUrl, $to)) {
$to = App::$Alias->baseUrl . '/' . $to;
}
$redirect = new FoundationRedirect($to);
$redirect->send();
exit('Redirecting to ' . $to . ' ...');
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.