//
app/Controllers/UserController.php
//
...highlighted code starting at line 42...
//
```
--------------------------------
### PHP HTTP Response Implementations
Source: https://github.com/tempestphp/tempest-docs/blob/main/src/Web/Blog/articles/2025-06-29-ten-tempest-tips.md
Demonstrates using specific response classes like Ok and Download from Tempest's HTTP component. These classes simplify returning different types of HTTP responses from controller actions. It also shows how to create custom response classes by implementing the Response interface.
```php
use Tempest\Http\Responses\Ok;
use Tempest\Http\Responses\Download;
use Tempest\Http\Response;
final class DownloadController
{
#[Get('/downloads')]
public function index(): Response
{
// …
return new Ok(/* … */);
}
#[Get('/downloads/{id}')]
public function download(string $id): Response
{
// …
return new Download($path);
}
}
use Tempest\Http\Response;
use Tempest\Http\IsResponse;
final class BookCreated implements Response
{
use IsResponse;
public function __construct(Book $book)
{
$this->setStatus( Tempest\Http\Status::CREATED);
$this->addHeader('x-book-id', $book->id);
}
}
```
--------------------------------
### HTML5 Spec Example: Missing Closing Head Tag
Source: https://github.com/tempestphp/tempest-docs/blob/main/src/Web/Blog/articles/2025-02-02-chasing-bugs-down-rabbit-holes.md
This snippet provides an example from the HTML5 specification demonstrating how a missing closing `` tag can lead to the body content being parsed as part of the head. This behavior is relevant to understanding why custom elements in the head can cause parsing errors.
```html