Want to know more about Nette? You've come to the right place. Here you will find all the tips, tricks, tutorials. Information for beginners and experts.
How do you write secure PHP templates without adding any runtime dependencies? Discover how Latte works as a build-time compiler for Tracy. Generate clean .phtml files, avoid manual htmlspecialchars, and achieve true type-safety.
New filters |column, |commas, and |limit, improved |slice for iterators, no more variable leaking from foreach, and automatic indentation removal. No revolution, but little things you'll appreciate every day.
For fourteen years, I tried to figure out why parallel tests on Windows take 7× longer than on Linux. A story full of dead ends, deadlocks, and a twenty-year-old bug in PHP that someone finally fixed.
The new attribute in Nette 3.2.9 automatically exposes presenter properties in the template – without manual assignment via `$this->template`. It eliminates boilerplate code and you naturally get type checking thanks to PHP, IDE, and static analysis.
Version 3.1 introduces Smart HTML Attributes: null removes the attribute, booleans work intuitively, arrays natively render into class and data-*. Together with nullsafe filters, strict types, and runtime type checking, this is the biggest DX improvement since version 3.0.
The new HttpAssert class in Nette Tester 2.5.6 lets you automatically verify status codes, headers, redirects, and response content. No more manually clicking through your website after every server configuration or nginx rule change.
Shared layouts with relative links broke when used by presenters from different levels of the directory structure. A new Latte tag in Nette Application 3.2.7 defines the base for relative links, so the layout works correctly regardless of which presenter calls it.
A new library that automatically handles versioning, image dimensions, and Vite integration. It works without configuration, and thanks to custom mappers, it covers anything – from product images to dynamic OG image generation.
Where to put presenters and classes? A new chapter in the Nette documentation introduces a domain-oriented directory structure that is understandable at first glance and naturally evolves as the project grows.
Thanks to lazy objects in PHP 8.4, services in the DI container are created only at the moment of actual use. Nette DI 3.2.4 makes it possible to activate this with a single line in the configuration – without any changes to your code.
The completely revamped Nette Database documentation covers all features of the library and introduces a brand new section with a thorough analysis of security risks. Practical examples of SQL injection and its prevention will help you write not only functional but also secure code.
Version 4.1.7 adds support for property hooks and asymmetric visibility. See how to elegantly generate modern code without getters and setters, define properties in interfaces, and fine-tune access to object properties.
Reading large files line by line, lazy mode in matchAll(), and the new Iterables class – three areas where Nette uses PHP generators to save memory and boost performance, without requiring you to change the way you write your code.
Latte 3.0.18 introduces locale settings and a new localDate filter that automatically adapts the format of dates, times, and numbers to local conventions. You specify the format once and Latte handles the order, separators, and translations for any language.
Latte introduces a new |group filter for grouping data by any criteria and an extended |sort filter with by and byKey parameters. Organizing and sorting data directly in templates has never been easier.
Nette Application 3.2 allows you to set up separate presenters for 4xx and 5xx errors. For client errors, you can use a full-featured presenter with the website layout, while for server errors, a minimal presenter where nothing else can fail.
The new attribute allows you to restrict access to presenters and their methods with just a few characters – for example, to POST requests only, AJAX calls, or same-origin requests. It enhances application security while also improving code readability.
Nette Framework 3.2 allows each presenter to have its own directory with all related files including templates. Thanks to the new `**` wildcard in mapping and intelligent template discovery, you get a cleaner and more modular application structure.
Nette Application 3.2 introduces aliases – easy-to-remember shortcuts for presenters and actions. Instead of long identifiers like `Front:Home:default`, you can simply write `@home`. They work in templates, during redirects, and anywhere else.
Get rid of your dependency on JavaScript pickers. Nette Forms now introduces addDate(), addTime(), addDateTime(), addColor(), and addFloat() methods with native browser support and full-fledged validation on both the client and server side.
With the end of 2023, support for Latte 2 comes to an end. The code of the third version has been completely rewritten and backporting changes is not possible. Although Latte 2 works on PHP 8.3 as well, we recommend upgrading to Latte 3 with the help of a detailed migration guide.
You've reached the end.