A lot of code constructs look like:
$form = $app->add('Form');
in better case there is an extra type hint like:
use atk4\ui\Form;
/* @var $form Form */
$form = $app->add('Form');
This is a feature request to add __construct option addTo (and maybe some generic option for things like addField) like:
use atk4\ui\Form;
$form = new Form(['addTo' => $app]);
which should be equivalent of $form = $app->add('Form');.
This will hugely improve utocomplete / refactoring / usability for programmers.
All usages and examples should be converted to the new syntax.
$app->add('Form') syntax should be dropped in the new 2.x branch and only $app->add($obj) should be supported. We should aim step by step for 100% refactorability.