traits
Table of Contents
Namespaces
- prepare
Traits
- ApiTrait
- Provides a controller-level `api` settings array, hydrated either from an
initialization array or from a PSR-11 container entry.
- AppTrait
- Trait providing helpers to manage the application instance and generate URLs.
- ArchiveTrait
- Provides helpers to bundle files into an archive (tar/zip) and stream it as a
PSR-7 download response, and to extract incoming archives back to disk.
- BaseUrlTrait
- Provides helper methods for managing the application's base URL.
- BenchTrait
- Provides lightweight benchmarking helpers to measure the execution time of a controller action.
- CborTrait
- Provides utility methods for managing CBOR serialization options and creating
standardized CBOR HTTP responses within controllers.
- CheckOwnerArgumentsTrait
- Utilities to validate "owner" arguments against Documents models.
- ConditionalRequestTrait
- Serves a file as a PSR-7 response with HTTP conditional-request support (`ETag` /
`Last-Modified` validators and the `304 Not Modified` short-circuit).
- CsrfTrait
- Trait exposing the CSRF token to controllers and templates.
- FileEncryptionTrait
- Provides helpers to encrypt/decrypt files and stream them as PSR-7 download responses,
delegating the cryptography to a configured `oihana\files\openssl\OpenSSLFileEncryption`.
- FileTrait
- Serves a file as a PSR-7 download response.
- ForceDocumentUrlTrait
- Adds a computed `url` property to documents returned by a controller.
- HttpCacheTrait
- Trait providing helpers to manage HTTP caching in controllers.
- ImageTrait
- Provides image helpers built on top of Imagick: dimension inspection, on-the-fly
resizing and shadow effects, and PSR-7 responses that stream an image file or an
in-memory Imagick blob.
- JsonTrait
- Provides utility methods for managing JSON encoding options and creating
standardized JSON HTTP responses within controllers.
- LanguagesTrait
- Trait LanguagesTrait
- LimitTrait
- Holds the limit/offset pagination bounds of a controller.
- MockTrait
- Provides a `mock` flag allowing a controller to switch its underlying model into a test/mock mode.
- OutputDocumentsTrait
- Provides a standardized way to output documents from controllers.
- PaginationTrait
- Trait providing helpers to manage the application/api pagination settings.
- ParamsStrategyTrait
- Provides a property to retrieve params in the Http request parameters or body.
- ParamsTrait
- Holds the default request parameters definition of a controller.
- PathTrait
- Provides path-related properties and helpers for controllers exposing resource routes.
- PrepareParamTrait
- Aggregates all the individual parameter preparation traits into a single one.
- RangeTrait
- Serves a file as a PSR-7 response with HTTP byte-range support (seekable downloads,
media streaming).
- RedirectsTrait
- Provides a `redirects` settings array allowing a controller to define static URL redirections.
- RouterTrait
- Provides helper methods to manage the application's router and base URL.
- SortAfterTrait
- Sorts a collection on a nested property declared by the model's `sortable.after` definition.
- StatusTrait
- Provides standardized methods for outputting HTTP status messages and JSON responses.
- TwigTrait
- Provides seamless integration of the **Twig** templating engine into controllers using the **Slim Framework**.
- UploadTrait
- Provides helpers to receive PSR-7 file uploads, validate them and store them on disk.
- ValidatorTrait
- Provides helper methods for validation and error handling within a controller.