Releases: nette/application
Release list
Released version 3.3.0
Nette Application 3.3 modernizes the foundations: PHP 8.3+ and Latte 3.1, more reliable CSRF protection driven by the browser itself, and a default presenter mapping that finally matches the structure used throughout the documentation. It also clears out a pile of long-forgotten legacy. Please test the RC and report anything that breaks before the stable release.
💥 Breaking Changes
- PHP 8.3 – 8.5 and Latte 3.1 are now required
- More reliable CSRF protection – same-origin is now verified via the browser's
Sec-Fetch-Siteheader instead of a SameSite cookie. - Default presenter mapping is now
App\Presentation\*\**Presenter Application::processRequest()returns aResponseinstead of sending it itself (#350) – sending is handled byrun(). This enables long-running runtimes (RoadRunner, FrankenPHP) and PSR integration.Presenter::getRequest()throws instead of returningnullwhen the presenter isn't running yetLatteFactory::create()now takes?Control– update any customLatteFactoryimplementation to the newcreate(?Control $control = null)signature.- Removed
{ifCurrent}– use{if isLinkCurrent('...')}. - Removed compatibility with old class names such as
PresenterComponentandIRouter.
⚠️ Deprecations
Mostly very old curiosities that few people knew existed – they still work but now emit a deprecation notice:
@annotations→ PHP attributes:@persistent→#[Persistent],@crossOrigin→#[Requires(sameOrigin: false)],@deprecated→#[Deprecated].- Array access on
RouteList–$router[] = new Route(...)and friends are replaced by$router->addRoute(...)/getRouters(). - Query string in a link destination –
link('Product:detail?id=1')should pass arguments instead:link('Product:detail', ['id' => 1]). Component::getParameter()second$defaultargument – use the??operator instead.- Some magic properties (
$presenter->view,$layout,$request,$session…) – use the getters.
✨ New Features
- Set the URL fragment straight from arguments –
link('Product:detail', ['#' => 'reviews'])produces...#reviews. The value is URL-encoded, must be scalar, and isn't passed on as a request parameter. - New
Presenter::completeTemplate()– aprotectedmethod extracted fromsendTemplate()that you can override to inject shared variables or set the template file before rendering.
Released version 3.2.12
A hardening release. Crafted or malformed request parameters that used to slip through as uncaught 500s now degrade gracefully to 4xx. If your site gets probed by scanners – and it does – these three fixes turn a batch of "Server Error" reports into clean Bad Request / Not Found responses.
- Self-links no longer crash on bad input – when a presenter builds a link to the current page (
redirect('this'),forward('this'),isLinkCurrent('this'), typically from a language switcher) while the current URL carries a parameter that doesn't fit the action's typed signature (e.g.?id=abcforint $id), the framework raised an uncaughtInvalidLinkException(HTTP 500). It now reports a properBadRequestException(4xx) through the newInvalidRequestParameterException. Explicitly passed bad link arguments still throwInvalidLinkException, so genuine programmer mistakes stay visible. - Numeric component ids no longer trigger a TypeError – a crafted query key such as
?1-foo=barproduced a numeric component id that hitgetComponent()'sstringtype hint and threw aTypeError(HTTP 500). The id is now cast to string and the request is handled gracefully. - Routing panel survives weird parameters – a request like
?do[]=xcould crash Tracy's routing panel during development. It now skips non-string presenter/signal/action values instead of throwing.
Released version 3.2.10
- Sharper phpDoc types and descriptions throughout the codebase
- Reverted the experimental
hasPresenter()/getPresenterIfExists()addition and the$throwdeprecation inComponent/Form::getPresenter()– the previous API behavior stays unchanged - {layout auto} no longer triggers infinite recursion – when used inside a referring template, the layout finder is now skipped instead of looping back on itself
- Response and router classes now use promoted readonly properties, trimming boilerplate across
Application,FileResponse,JsonResponse,RedirectResponse,TextResponse,ForwardResponseandCliRouter - Callback parameters in
PresenterFactory,CallbackResponseandMultiplierare normalized toClosurefor stronger typing
Released version 3.2.9
- added #[TemplateVariable]
- LinkGenerator: throws an error when the link points to #[Requires(forward: true)]
Released version 3.2.8
Released version 3.2.7
- Latte: added filter
|absoluteUrland{linkBase} - SnippetRuntime: Fixed snippets rendering when multiple templates are rendered (#349)
- TemplateFactory: does not assign the default property to the template if it does not match the type #352
- class Template is abstract
- error 500: improved CSS style reset nette/tracy#581
- optimized global function calls
Released version 3.2.6
- LatteExtension: added option 'locale'
- LatteExtension: automatically passes translator to Latte\Essential\TranslatorExtension
- support for PHP 8.4
Released version 3.2.5
- ApplicationExtension: checks the correct usage of attributes
Component::tryCall()throws BadRequestExceptionMultiplier::createComponent()allow to return a null (#327)- LatteExtension: fixed v3.2.3
Released version 3.1.15 (end of support)
Component::tryCall()throws BadRequestException- AbortException & BadRequestException extends LogicException
- Latte: sets Tag::$node
- composer: relaxed dependencies
Released version 3.2.3
- added feature "link aliases"
- added attributes
#[Requires]and#[Deprecated] - Presenter: added
switch() - PresenterFactory: support for location Foo/FooPresenter via
** - Presenter: support for templates without /template folder
- LinkGenerator: unified with link generation in presenters
- added
ComponentReflection::getActionRenderMethod()&getSignalMethod() - Latte: CacheExtension & FormExtension are added before user extensions #320
- Latte: UIExtension is added before user extensions if $control is passed to
LatteFactory::create() - RoutingPanel: show presenter class even if it doesn't exist
- Revert "ApplicationExtension: $catchExceptions can be '4xx' in addition to bool"