Repository navigation
Internals Response Senders JsSender
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/response/senders/JsSender.php · Snapshot 8411f4287706.
Response builds status, headers and data/file payloads, chooses a MIME sender, and emits HTTP output. JSON arrays are wrapped in a status/message/data envelope.
class JsSender extends AbstractSenderNo own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.
| Method | Signature |
|---|---|
| supportedMimes | public function supportedMimes(): array |
| send | public function send(mixed $payload, int $status, array $headers): void |
public function supportedMimes(): arrayReturn expressions (including local callbacks): ['application/javascript', 'text/javascript'].
Implementation, validation guards and interaction order
public function supportedMimes(): array
{
return ['application/javascript', 'text/javascript'];
}public function send(mixed $payload, int $status, array $headers): void| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$payload |
mixed $payload |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
$status |
int $status |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
$headers |
array $headers |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
Delegates to emitStatus(), emitContentType(), emitHeaders(), streamFile().
Implementation, validation guards and interaction order
public function send(mixed $payload, int $status, array $headers): void
{
$this->emitStatus($status);
$this->emitContentType('application/javascript');
$this->emitHeaders($headers);
if (is_string($payload) && file_exists($payload)) {
$this->streamFile($payload);
} else {
echo (string) $payload;
}
}AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes