Upgrading

Upgrading to Version 4.0

Version 4.0 is still under development and this page is a work in progress.

Most changes affect only authors of custom components; ordinary application code is unaffected. See the release blog post for the full story.

  • The getComponents() method no longer accepts the $deep and $filterType parameters and always returns an array of the direct children. For the whole subtree use getComponentTree(), optionally combined with array_filter() for type filtering.
  • Attach notifications are now delivered top-down: a parent's $attached callback runs before its children's, which lets the parent prepare its state or even remove a child before it is processed. The detachment order is unchanged (children first).
  • The overridable attached() and detached() methods were removed; register callbacks via monitor($type, $attached, $detached) instead.
  • The Component class no longer uses the Nette\SmartObject trait, so magic property access is gone from the base class (Control and BaseControl add the trait themselves).
  • The NAME_SEPARATOR constant was renamed to NameSeparator.

Upgrading to Version 3.0

The constructor of Nette\ComponentModel\Component has not been used for years and was removed in version 3.0. It is a BC break: if you call the parent constructor in a component or presenter, you must remove the call.

version: 4.x