ATK UI 2.1 Release

ATK team is excited to announce availability of 2.1 branches across core ATK repositories. This release is primarily focused on clean-ups and optimisation in our 2.x branch. This article will highlight some of the more exciting new additions:

Changes to Versioning

I already have discussed details here: IMPORTANT: New Release Mechanics

New UI Demo Navigation and interactive Demo

Our demo-site ( has been showcasing 1.7 version of ATK UI and we couldn’t update it to 2.0 due to hosting issues. This has been addressed now and you should see up-to-date version of ATK UI.

There is also new navigation (number of pages have been getting too long) and we’ve added “Demos” - interactive multi-step wizards to specifically take you through a specific set of features.

If you haven’t had an opportunity to look into “User Actions” the wizard will take you through some of the key points.

New default initializer “addTo()” for better type hinting

For a long time we used add() method to initialize children in UI and elsewhere in ATK. We are introducing alternative syntax - addTo which has better type hinting:

// old
$button = $page->add(['Button', 'Click Me']);
$button->icon.. // will appear as warning in IDE, because add() returns View class

// new format

$button = Button::addTo($page, ['Click Me']);
$button->icon..  // will type-hint correctly because Button::addTo returns @self 

Because this is a huge change, we will keep add() compatibility for all of 2.x releases of ATK (or longer). No need to refactor this code, however we have updated all demos and examples to use a new format.

Unified and improved Unit Testing system

The build engine for all repositories has been revamped and we have adopted PSR-12 standard. As a result - lot of cosmetic changes and much faster build times! We are now including CS Fixer too and it’s recommended for all ATK repositories and plugins.

Migrating to 2.1 and potential BC break summary

  • Persistence::$driver property has been renamed to Persistence::$driverType. This can have values such as“mysql”, “oci”, “sqlite” and more (atk4/schema is updated accordingly)
  • ATK gradually introduces more type-hinting, so if your code have been extending any of the core classes and overriding, you may need to make sure your function definition is compatible.
  • If you were extending “PHPUnit7_AgileTestCase” in your unit tests - replace it with“atk4\core\AtkPhpunit\TestCase”.
  • If you are using “ConfigTrait” with a format “php-inline” replace it with “php”, which now will always return config.
  • Classes “Persistence_Array”, “Persistence_SQL”, “Reference_Many” and some other classes with underscores have been deprecated in 2.0 are now removed.

Hook breaker class

Currently you can break out of hooks and even pass some information, which will then be returned by hook() method. Version 2.1 can now output hook breaker object too. This is convenient if you have multiple callbacks registered by multiple objects and you wish to learn which one broke the hook.

Models to Model joins support with addWith()

For a while now we wanted to introduce joins between models. It is now possible as we are introducing addWith() for models. See documentation and some examples.

Model introduces setNull() for all field types

There are two flags for model field - mandatory and required. You can read more about them in the documentation. Those flags prevent you from setting

New and improved elements

We have introduced the following new or improved UI elements:

  • DropDownCascade offers multiple cascaded DropDowns which show filtered, cascaded results based on the parent DropDown (e.g., Country > District > City).
  • Maestro layout is an improvement of the Admin layout with the possibility to collapse or expand left menu groups and their items.
  • ActionModal windows can now be easily configured in size by e.g. $grid->addModalAction([‘icon’=>‘user edit’],[‘class’ => [‘tiny’]],…

PRs with significant BC-break:

PRs with other significant changes:

For full list of changes:

1 Like

Great work!!! I love the new demo and what you can do with it!