Function index¶
Generated from the installed releases listed below. Regenerate this snapshot after a
release; function signatures and namespaces are read through PHP reflection.
Functions marked @internal are excluded. Import helpers with use function in each
PHP file, including templates. See Dependency Injection
for services exposed through these helpers.
naf/framework¶
Version v0.2.13 · Fundamentals
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
abort(int $statusCode = 404, string $message = ''): never |
Abort request with status code and message | Naf |
Abort a request |
app(): Naf\Core\App |
Get the application instance | Naf |
Application lifecycle |
config(?string $key = null, mixed $default = null): mixed |
Get configuration value by key | Naf |
Read configuration |
env(): string |
Get the current environment | Naf |
Application environment |
event(): Naf\Core\EventManager |
Get the event dispatcher instance | Naf |
Events |
guard(): Naf\Support\Guard |
Get the guard instance | Naf |
Guard rules |
json(mixed $data, int $status = 200, array $headers = []): Psr\Http\Message\ResponseInterface |
Create JSON response | Naf |
Responses |
log(): Psr\Log\LoggerInterface |
Get logger instance | Naf |
Logging |
param(): Naf\Support\RequestParameter |
Get request parameter handler instance | Naf |
Combined request parameters |
plugin(?string $name = null): Naf\Support\Plugin|array |
Get a specific plugin, or all when no argument is given | Naf |
Plugin metadata |
redirect(string $url, int $status = 302): Psr\Http\Message\ResponseInterface |
Create a redirect response | Naf |
Redirect and refresh |
refresh(): Psr\Http\Message\ResponseInterface |
Create a refresh response redirecting to the current path | Naf |
Redirect and refresh |
request(): Psr\Http\Message\ServerRequestInterface|Psr\Http\Message\RequestInterface |
Get current request instance | Naf |
Read the request |
response(mixed $content = '', int $status = 200, array $headers = []): Psr\Http\Message\ResponseInterface |
Create a new response | Naf |
Responses |
route(?string $name = null, array $params = []): Naf\Core\Route|string |
Get the route instance or generate URL for a named route | Naf |
Routing |
naf/auth¶
Version v0.2.4 · Authentication and permissions
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
auth(): Naf\Auth\Auth |
The shared manager registered by the plugin bootstrap | Naf\Auth |
Authentication and permissions |
naf/board¶
Version v0.1.9 · Nafinity
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
choice(array $arguments): string |
Render the reusable select | Naf\Board |
Nafinity |
extensions(): Naf\Board\ExtensionRegistry |
The container-bound extension registry | Naf\Board |
Nafinity |
field(array $arguments): string |
Render a labelled form field | Naf\Board |
Nafinity |
partial(string $template, array $data = []): string |
Render a mapped partial through the application's page renderer | Naf\Board |
Nafinity |
settings(): Naf\Board\Settings |
Declared settings for the signed-in person | Naf\Board |
Nafinity |
slot(string $slot, Naf\Board\Support\SlotContextInterface|Naf\Board\Support\UiContext $context, array $extra = []): string |
Render everything contributed to a named slot | Naf\Board |
Nafinity |
template(string $template): string |
Resolve a logical view name through the registered view mappings | Naf\Board |
Nafinity |
naf/cli¶
Version v0.2.4 · Console commands
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
command(): Naf\CLI\Support\CommandRegistry |
— | Naf\CLI |
Console commands |
naf/client¶
Version v0.2.3 · HTTP client
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
client(): Naf\Client\Core\Client |
— | Naf\Client |
HTTP client |
naf/cms¶
Version v0.0.3 · NafCMS
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
audit(bool $reset = false): Naf\CMS\Support\Audit |
— | Naf\CMS |
NafCMS |
audit_log(Naf\CMS\Support\AuditEntry|string $action, ?string $subjectType = null, ?string $subjectKey = null, mixed $oldValue = null, mixed $newValue = null, array $meta = []): bool |
— | Naf\CMS |
NafCMS |
cms(bool $reset = false, ?Naf\CMS\Support\Cms $override = null): Naf\CMS\Support\Cms |
— | Naf\CMS |
NafCMS |
cms_reset(): void |
Reset request-scoped helper state between tests | Naf\CMS |
NafCMS |
csp_nonce(): string |
— | Naf\CMS |
NafCMS |
user(?Naf\CMS\Support\UserHelper $override = null, bool $reset = false): ?Naf\CMS\Support\UserHelper |
The override exists for isolated tests only; production callers must rely on the authenticated session | Naf\CMS |
NafCMS |
naf/database¶
Version v0.2.4 · Database
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
database(): ?PDO |
— | Naf\Database |
Database |
naf/flow¶
Version v0.1.0 · Flow
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
page(string $template, array $vars = [], ?string $fragment = null): Psr\Http\Message\ResponseInterface |
The host chooses both templates; clients never supply a template path | Naf\Flow |
Flow |
naf/form¶
Version v0.2.4 · Forms and validation
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
csrf(): Naf\Form\Support\Csrf |
— | Naf\Form |
Forms and validation |
error($field, Naf\Form\Core\Validator $validator): ?string |
— | Naf\Form |
Forms and validation |
error_class($field, Naf\Form\Core\Validator $validator): string |
— | Naf\Form |
Forms and validation |
has_error($field, Naf\Form\Core\Validator $validator): bool |
— | Naf\Form |
Forms and validation |
is_post(): bool |
— | Naf\Form |
Forms and validation |
memory(string $key, mixed $default = null): ?string |
The submitted value of a field in the current request, for refilling a form | Naf\Form |
Forms and validation |
memory_checked(string $key, mixed $value = 'on'): string |
— | Naf\Form |
Forms and validation |
memory_selected(string $key, mixed $expectedValue): string |
— | Naf\Form |
Forms and validation |
validator(): Naf\Form\Core\Validator |
— | Naf\Form |
Forms and validation |
naf/i18n¶
Version v0.2.2 · Translations
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
lang(): ?string |
— | Naf\I18n |
Translations |
t(string $key, array $params = []): string |
— | Naf\I18n |
Translations |
translation_paths(): Naf\I18n\Support\TranslationPathRegistry |
The registry of directories translations are read from | Naf\I18n |
Translations |
translator(): Naf\I18n\Core\Translator |
— | Naf\I18n |
Translations |
naf/mail¶
Version v0.2.3 · Sending mail
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
mail(): Naf\Mail\Models\Mail |
— | Naf\Mail |
Sending mail |
mailer(?Naf\Mail\Core\TransportInterface $transport = null): Naf\Mail\Core\Mailer |
Use a separate mailer for an explicit transport, or retrieve the shared mailer | Naf\Mail |
Sending mail |
naf/mcp¶
Version v0.2.7 · MCP tools
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
tokens(): Naf\MCP\Store\TokenStoreInterface |
— | Naf\MCP |
MCP tools |
tool(): Naf\MCP\Support\ToolRegistry |
— | Naf\MCP |
MCP tools |
naf/monitoring¶
Version v0.1.0 · Monitoring
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
monitor(?string $name = null, array $labels = []): Naf\Monitoring\Monitor|Naf\Monitoring\Metric |
Retrieve the monitoring service, or a declared metric with per-call labels | Naf\Monitoring |
Monitoring |
naf/oauth-client¶
Version v0.2.4 · OAuth client
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
oauth(string $provider): Naf\OAuth\Client\Core\Flow |
The configured external provider of that name, registered by the plugin bootstrap | Naf\OAuth\Client |
OAuth client |
oauth_button(string $provider, ?string $label = null, ?string $next = null): string |
A link that starts a login with this provider | Naf\OAuth\Client |
OAuth client |
oauth_token(string $provider): ?Naf\OAuth\Client\Token\ProviderToken |
A provider token for the signed-in account that can be used right now | Naf\OAuth\Client |
OAuth client |
naf/oauth-server¶
Version v0.2.6 · OAuth authorization server
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
token(): Naf\OAuth\Server\Core\TokenContext |
What the bearer token on this request allows | Naf\OAuth\Server |
OAuth authorization server |
naf/orm¶
Version v0.2.3 · ORM and repositories
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
em(): Naf\ORM\Core\EntityManager |
— | Naf\ORM |
ORM and repositories |
repo(string $repository): Naf\ORM\Repository\AbstractRepository |
— | Naf\ORM |
ORM and repositories |
naf/queue¶
Version v0.2.5 · Queues and workers
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
queue(?string $channel = null): Naf\Queue\Core\Queue |
— | Naf\Queue |
Queues and workers |
naf/rbac¶
Version v0.1.4 · Roles and permissions
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
permissions(): Naf\Rbac\Registry\PermissionRegistry |
What this installation knows how to grant | Naf\Rbac |
Roles and permissions |
rbac(): Naf\Rbac\Rbac |
The roles and permissions themselves | Naf\Rbac |
Roles and permissions |
roles(): Naf\Rbac\Registry\RoleRegistry |
The roles a host ships with, and the kinds of place they may be granted in | Naf\Rbac |
Roles and permissions |
naf/schedule¶
Version v0.2.4 · Scheduled jobs
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
scheduler(): Naf\Schedule\Core\Scheduler |
— | Naf\Schedule |
Scheduled jobs |
naf/session¶
Version v0.2.4 · Sessions
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
session(): Naf\Session\Core\Session |
— | Naf\Session |
Sessions |
naf/storage¶
Version v0.1.0 · File storage
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
storage(?string $name = null): Naf\Storage\Storage |
Retrieve the configured default disk or a named disk | Naf\Storage |
File storage |
naf/view¶
Version v0.2.3 · Views and templates
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
asset(): Naf\View\Core\Asset |
— | Naf\View |
Views and templates |
render(string $template, array $vars = []): Psr\Http\Message\ResponseInterface |
— | Naf\View |
Views and templates |
s(array|string|null $value): array|string|null |
— | Naf\View |
Views and templates |
view(string $tpl, array $vars = []): string |
— | Naf\View |
Views and templates |
naf/websocket¶
Version v0.1.1 · WebSocket notifications
| Signature | Purpose | Namespace to import from | Guide |
|---|---|---|---|
live(): bool |
Whether an installation has this switched on at all | Naf\Websocket |
WebSocket notifications |
publisher(): Naf\Websocket\Publisher |
How the application says that something changed | Naf\Websocket |
WebSocket notifications |
token(string $subject, array $channels): string |
A token for these channels, for the browser that is being served right now | Naf\Websocket |
WebSocket notifications |
71 public functions across 23 packages.