Class Atk4\Ui\Modal

extends View

This class add modal dialog to a page.

Modal are added to the layout but their content is hidden by default. $modal->jsShow() is the triggered needed to actually display the modal.

Modal can be use as a regular view, simply by adding other view to it. Message::addTo($modal, ['title' => 'Welcome to Agile Toolkit'])->text('Your text here');

Modal can add content dynamically via CallbackLater. $modal->set(function (View $p) { Form::addTo($p); });

Modal can use Fomantic-UI predefine method onApprove or onDeny by passing a jsAction to Modal::addDenyAction or Modal::addApproveAction method. It will not close until the jsAction return true. $modal->addDenyAction('No', new JsExpression('function () { window.alert('Cannot do that.'); return false; }')); $modal->addApproveAction('Yes', new JsExpression('function () { window.alert('You are good to go!'); }'));

You may also prevent modal from closing via the esc or dimmed area click using $modal->notClosable().

Located at ui/src/Modal.php
Methods
Methods inherited from Atk4\Ui\View
__construct(), setModel(), setSource(), setMissingProperty(), setElement(), link(), init(), getExecutorFactory(), add(), getClosestOwner(), addClass(), removeClass(), setStyle(), removeStyle(), setAttr(), removeAttr(), url(), jsUrl(), _getStickyArgs(), stickyGet(), recursiveRender(), renderAll(), renderTemplateToHtml(), render(), renderToTab(), renderToJsonArr(), getHtml(), js(), vue(), jsEmitEvent(), jsGetStoreData(), jsClearStoreData(), jsAddStoreData(), jsReload(), on(), getHtmlId(), getJsRenderActions(), getJs()
Methods inherited from Atk4\Ui\AbstractView
getOwner()
Methods used from Atk4\Core\AppScopeTrait
assertInstanceOfApp(), issetApp(), getApp(), setApp()
Methods used from Atk4\Core\ContainerTrait
_uniqueElementName(), _addContainer(), removeElement(), _shorten(), getElement(), hasElement()
Methods used from Atk4\Core\InitializerTrait
isInitialized(), assertIsInitialized(), invokeInit()
Methods used from Atk4\Core\StaticAddToTrait
_addToAdd(), addTo(), addToWithCl(), addToWithClUnsafe()
Methods used from Atk4\Core\TrackableTrait
issetOwner(), setOwner(), unsetOwner(), getDesiredName(), destroy()
Properties
Properties inherited from Atk4\Ui\View
$_jsActions, $model, $region, $class, $style, $attr, $template, $content, $element, $executorFactory, $stickyArgs
Properties inherited from Atk4\Ui\AbstractView
$_addLater, $_rendered, $elements
Properties used from Atk4\Core\AppScopeTrait
$_app, $maxNameLength, $uniqueNameHashes
Properties used from Atk4\Core\ContainerTrait
$_elementNameCounts
Properties used from Atk4\Core\InitializerTrait
$_initialized
Properties used from Atk4\Core\NameTrait
$name
Properties used from Atk4\Core\TrackableTrait
$_owner, $shortName