Response
About 1 min
Response
- Full name:
\Hazaar\Controller\Helper\Response
- Parent class:
\Hazaar\Controller\Helper
Methods
file
public file(\Hazaar\Controller\Response\File|string $file, ?\Hazaar\File\Manager $manager = null): \Hazaar\Controller\Response\File
Parameters:
Parameter | Type | Description |
---|---|---|
$file | \Hazaar\Controller\Response\File|string | |
$manager | ?\Hazaar\File\Manager |
html
public html(string $content, int $status = 200): \Hazaar\Controller\Response\HTML
Parameters:
Parameter | Type | Description |
---|---|---|
$content | string | |
$status | int |
image
public image(string $filename, int $quality = 8, ?\Hazaar\File\Manager $manager = null): \Hazaar\Controller\Response\Image
Parameters:
Parameter | Type | Description |
---|---|---|
$filename | string | |
$quality | int | |
$manager | ?\Hazaar\File\Manager |
json
public json(array|\stdClass $data, int $status = 200): \Hazaar\Controller\Response\JSON
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array|\stdClass | |
$status | int |
public PDF(string $file, bool $downloadable = true): \Hazaar\Controller\Response\PDF
Parameters:
Parameter | Type | Description |
---|---|---|
$file | string | |
$downloadable | bool |
text
public text(string $content, int $status = 200): \Hazaar\Controller\Response\Text
Parameters:
Parameter | Type | Description |
---|---|---|
$content | string | |
$status | int |
view
public view(string $name): \Hazaar\Controller\Response\View
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string |
xml
public xml(string $content, int $status = 200): \Hazaar\Controller\Response\XML
Parameters:
Parameter | Type | Description |
---|---|---|
$content | string | |
$status | int |
Inherited methods
__construct
final public __construct(?\Hazaar\Controller $controller = null, array $args = []): mixed
- This method is final.
Parameters:
Parameter | Type | Description |
---|---|---|
$controller | ?\Hazaar\Controller | |
$args | array |
getName
Retrieves the name of the current class without the namespace.
public getName(): string
This method uses the get_class
function to get the fully qualified class name of the current object, and then extracts the class name by removing the namespace part.
Return Value:
the name of the current class without the namespace
import
public import(array $args = []): void
Parameters:
Parameter | Type | Description |
---|---|---|
$args | array |
Automatically generated on 2024-11-14