Skip to content

Commit

Permalink
fix behat
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 11, 2023
1 parent a1d9162 commit b531f60
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
3 changes: 3 additions & 0 deletions demos/form/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
$form->onSubmit(function (Form $form) {
$message = 'field = ' . print_r($form->model->get('field'), true) . '; <br> control = ' . print_r($form->model->get('control'), true);
$view = new Message('Date field vs control:');
$view->setApp($form->getApp());
$view->invokeInit();
$view->text->addHtml($message);

Expand Down Expand Up @@ -112,6 +113,7 @@
$form->buttonSave->set('Save3');
$form->onSubmit(function (Form $form) {
$view = new Message('some header');
$view->setApp($form->getApp());
$view->invokeInit();
$view->text->addParagraph('some text ' . random_int(1, 100));

Expand All @@ -124,6 +126,7 @@
$form->buttonSave->set('Save4');
$form->onSubmit(function (Form $form) {
$view = new Message('some header');
$view->setApp($form->getApp());
$view->invokeInit();
$view->text->addParagraph('some text ' . random_int(1, 100));

Expand Down
6 changes: 2 additions & 4 deletions docs/app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ Purpose of App class
.. php:namespace:: Atk4\Ui
.. php:class:: App
App is a mandatory object that's essential for Agile UI to operate. If you don't create App object explicitly, it
will be automatically created if you execute `$component->invokeInit()` or `$component->render()`.

In most use-scenarios, however, you would create instance of an App class yourself before other components::
App is a mandatory object that's essential for Agile UI to operate. You should create instance
of an App class yourself before other components::

$app = new \Atk4\Ui\App('My App');
$app->initLayout([\Atk4\Ui\Layout\Centered::class]);
Expand Down
1 change: 1 addition & 0 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ of application layout with a line::
To render a component individually and get the HTML and JavaScript use this format::

$form = new Form();
$form->setApp($app);
$form->invokeInit();
$form->setModel(new User($db));

Expand Down
8 changes: 2 additions & 6 deletions src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,7 @@ public function removeAttr($property)
public $stickyArgs = [];

/**
* Build an URL which this view can use for js call-backs. It should
* be guaranteed that requesting returned URL would at some point call
* $this->invokeInit().
* Build an URL which this view can use for JS callbacks.
*
* @param array $page
*/
Expand All @@ -517,9 +515,7 @@ public function jsUrl($page = []): string
}

/**
* Build an URL which this view can use for call-backs. It should
* be guaranteed that requesting returned URL would at some point call
* $this->invokeInit().
* Build an URL which this view can use for callbacks.
*
* @param string|array $page URL as string or array with page name as first element and other GET arguments
*/
Expand Down

0 comments on commit b531f60

Please sign in to comment.