SitemapController
final class SitemapController extends AbstractController (View source)
Methods
Initializes the controller runtime context before an action is executed.
Returns the current PSR-7 server request for the dispatched action.
Returns a combined request input value.
Returns a query string parameter.
Returns all query string parameters.
Returns a parsed body value.
Returns all parsed body values.
Returns a request header value.
Returns all request headers grouped by header name.
Returns a cookie parameter.
Returns all cookie parameters.
Returns a server parameter.
Returns all server parameters.
Returns the raw request body.
Returns a value from the decoded JSON request payload.
Returns the decoded JSON request payload.
Reports whether the request content type is JSON.
Reports whether the request Accept header allows JSON responses.
Reports whether the request should be treated as expecting JSON.
Returns an uploaded file entry by name.
Returns all uploaded files indexed by input name.
Reports whether the request was made through AJAX/XHR semantics.
Returns the resolved client IP address when available.
Returns the User-Agent header value.
Returns the Referer header value.
Returns the normalized HTTP method.
Reports whether the current request uses the given HTTP method.
Reports whether the request method is GET.
Reports whether the request method is POST.
Reports whether the request method is PUT.
Reports whether the request method is PATCH.
Reports whether the request method is DELETE.
Reports whether the request method is HEAD.
Reports whether the request method is OPTIONS.
Returns an input value converted to string semantics.
Returns an input value converted to integer semantics.
Returns an input value converted to float semantics.
Returns an input value converted to boolean semantics.
Creates a plain text response.
Creates an HTML response.
Creates a JSON response from the provided payload.
Creates a redirect response.
Creates a file download response.
Creates a generic response with an explicit content type.
Creates a streamed response produced by the given callback.
Returns the application context available to the controller.
Returns the breadcrumb component service.
Returns the framework URL generator.
Returns the form validation service.
Returns the upload factory service.
Returns the translator service.
Returns the filesystem service.
Returns the flash message bag.
Returns a controller-scoped service resolved from the container.
Sets the active locale on both translator and validator services.
Translates a localized key with optional replacements.
Returns the complete translation group for the given locale.
Details
setControllerContext
final void
setControllerContext(ServerRequestInterface $request, ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory, ContainerInterface $container)
Initializes the controller runtime context before an action is executed.
This framework-managed entrypoint stores the current request, response factory, stream factory, and service container, then creates the controller context, response helpers, and service accessors used by derived controllers.
request
protected ServerRequestInterface
request()
Returns the current PSR-7 server request for the dispatched action.
input
protected mixed
input(string $key, mixed $default = null)
Returns a combined request input value.
query
protected mixed
query(string $key, mixed $default = null)
Returns a query string parameter.
queryAll
protected array
queryAll()
Returns all query string parameters.
post
protected mixed
post(string $key, mixed $default = null)
Returns a parsed body value.
postAll
protected array
postAll()
Returns all parsed body values.
header
protected string|null
header(string $name, string|null $default = null)
Returns a request header value.
headers
protected array
headers()
Returns all request headers grouped by header name.
cookie
protected mixed
cookie(string $name, mixed $default = null)
Returns a cookie parameter.
cookies
protected array
cookies()
Returns all cookie parameters.
server
protected mixed
server(string $key, mixed $default = null)
Returns a server parameter.
serverAll
protected array
serverAll()
Returns all server parameters.
body
protected string
body()
Returns the raw request body.
jsonInput
protected mixed
jsonInput(string $key, mixed $default = null)
Returns a value from the decoded JSON request payload.
jsonPayload
protected array
jsonPayload()
Returns the decoded JSON request payload.
isJsonRequest
protected bool
isJsonRequest()
Reports whether the request content type is JSON.
acceptsJson
protected bool
acceptsJson()
Reports whether the request Accept header allows JSON responses.
expectsJson
protected bool
expectsJson()
Reports whether the request should be treated as expecting JSON.
file
protected UploadedFileInterface|array|null
file(string $name)
Returns an uploaded file entry by name.
files
protected array
files()
Returns all uploaded files indexed by input name.
isAjaxRequest
protected bool
isAjaxRequest()
Reports whether the request was made through AJAX/XHR semantics.
ip
protected string|null
ip()
Returns the resolved client IP address when available.
userAgent
protected string|null
userAgent(string|null $default = null)
Returns the User-Agent header value.
referer
protected string|null
referer(string|null $default = null)
Returns the Referer header value.
method
protected string
method()
Returns the normalized HTTP method.
isMethod
protected bool
isMethod(HttpMethod|string $method)
Reports whether the current request uses the given HTTP method.
isGet
protected bool
isGet()
Reports whether the request method is GET.
isPost
protected bool
isPost()
Reports whether the request method is POST.
isPut
protected bool
isPut()
Reports whether the request method is PUT.
isPatch
protected bool
isPatch()
Reports whether the request method is PATCH.
isDelete
protected bool
isDelete()
Reports whether the request method is DELETE.
isHead
protected bool
isHead()
Reports whether the request method is HEAD.
isOptions
protected bool
isOptions()
Reports whether the request method is OPTIONS.
inputString
protected string
inputString(string $key, string $default = '')
Returns an input value converted to string semantics.
inputInt
protected int
inputInt(string $key, int $default = 0)
Returns an input value converted to integer semantics.
inputFloat
protected float
inputFloat(string $key, float $default = 0.0)
Returns an input value converted to float semantics.
inputBool
protected bool
inputBool(string $key, bool $default = false)
Returns an input value converted to boolean semantics.
text
protected ResponseInterface
text(string $content, int $status = 200)
Creates a plain text response.
html
protected ResponseInterface
html(string $content, int $status = 200)
Creates an HTML response.
json
protected ResponseInterface
json(array $payload, int $status = 200)
Creates a JSON response from the provided payload.
redirect
protected ResponseInterface
redirect(string $to, int $status = 302)
Creates a redirect response.
download
protected ResponseInterface
download(string $filePath, string|null $downloadName = null, string $contentType = 'application/octet-stream')
Creates a file download response.
response
protected ResponseInterface
response(string $content = '', int $status = 200, string $contentType = 'text/html; charset=UTF-8')
Creates a generic response with an explicit content type.
stream
protected ResponseInterface
stream(callable $producer, int $status = 200, string $contentType = 'text/plain; charset=UTF-8', array $headers = [])
Creates a streamed response produced by the given callback.
controllerService
protected object
controllerService(string $id)
Returns a controller-scoped service resolved from the container.
setLang
protected void
setLang(string|null $locale)
Sets the active locale on both translator and validator services.
trans
protected string
trans(string $key, array $replacements = [], string|null $locale = null)
Translates a localized key with optional replacements.
transGroup
protected array
transGroup(string $group, string|null $locale = null)
Returns the complete translation group for the given locale.
__construct
__construct(SitemapConfig $config, SitemapGenerator $generator, ApplicationContext $context)
No description
index
ResponseInterface
index()
No description