It is my fervent wish that this file guide every AI coding agent working with code in this repository.
Any distilled, agent-facing documentation for this package - how it works
internally and the rationale behind key design decisions - lives in docs/.
Consult it before non-trivial changes; it is the source of truth from which the
public manual is distilled.
The presenter lifecycle, link generation, persistent state, routing, and template
lookup carry subtle non-local invariants - read docs/internals before touching
them.
Nette Application is a full-stack, component-based MVC framework library for PHP -
the core application layer of the Nette Framework: presenters, components, routing,
templating integration, and the request/response cycle. It is a library package,
not a runnable application, and integrates with the rest of the framework through
src/Bridges (DI, Latte, Tracy).
- PHP Version: 8.3 - 8.5
- Package:
nette/application
# Run all tests
composer tester # or: vendor/bin/tester tests -s
# Run one test directory / file
vendor/bin/tester tests/UI -s
php tests/Application/Presenter.twoDomains.phpt
# Static analysis (PHPStan level 8)
composer phpstan- Every file starts with
declare(strict_types=1);; tabs for indentation; Nette Coding Standard (PSR-12 based) with the opening brace on its own line. - Tests are Nette Tester
.phptfiles mirroringsrc/undertests/; usetest()/testException()andAssert::*. Temp files go totests/tmp/{pid}/, andtests/types/holds PHPStan type-inference fixtures.
- The presenter lifecycle is exact and load-bearing. The precise phase order
(action, canonicalization, signal dispatch,
beforeRender,render, theonRenderhook,afterRender),AbortException-based termination, and the 4xx-not-500 invalid-link contract are documented indocs/internals/lifecycle.md. Don't reconstruct them from memory. - Links and persistent state span the whole component tree. Link-generation
modes and whole-tree global-state aggregation are the trickiest code here; see
docs/internals/link-generation.mdandpersistent-state.md. - User-facing how-to (routing DSL, signals, snippets, component factories, flash messages, DI/NEON configuration) is manual material and lives in the public web docs, not here.