Controller traits

This commit is contained in:
2020-07-02 01:06:39 -04:00
parent 8272c71c34
commit 4d26000a26
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,12 @@
<?php
namespace ProVM\Common\Define\Controller;
use Psr\Http\Message\ResponseInterface as Response;
trait Redirect {
public function withRedirect(Response $request, string $uri, int $status = 301): Response {
return $response
->withHeader('Location', $uri)
->withStatus($status);
}
}