diff --git a/docs/app.md b/docs/app.md index 5dce9296c3..e755c3bd3f 100644 --- a/docs/app.md +++ b/docs/app.md @@ -434,10 +434,7 @@ Each layout, depending on it's content, may come with several views that you can ## Admin Layout -:::{php:namespace} Atk4\Ui\Layout -::: - -:::{php:class} Admin +:::{php:class} Layout\Admin ::: Agile Toolkit comes with a ready to use admin layout for your application. The layout is built diff --git a/docs/autocomplete.md b/docs/autocomplete.md index 54dd7a0405..eb2d4fdf1b 100644 --- a/docs/autocomplete.md +++ b/docs/autocomplete.md @@ -1,11 +1,11 @@ -:::{php:namespace} Atk4\Ui\Form\Control +:::{php:namespace} Atk4\Ui ::: (autocomplete)= # AutoComplete Form Control -:::{php:class} AutoComplete +:::{php:class} Form\Control\AutoComplete ::: Agile UI uses "Form\Control\Dropdown" by default on the form, but there is also implementation diff --git a/docs/dataexecutor.md b/docs/dataexecutor.md index 563608b6da..276fff3279 100644 --- a/docs/dataexecutor.md +++ b/docs/dataexecutor.md @@ -1,4 +1,4 @@ -:::{php:namespace} Atk4\Ui\UserAction +:::{php:namespace} Atk4\Ui ::: (dataexecutor)= @@ -19,15 +19,15 @@ Demo: https://ui.agiletoolkit.org/demos/data-action/actions.php All executors must implement the ExecutorInterface or JsExecutorInterface interface. -:::{php:interface} ExecutorInterface +:::{php:interface} UserAction\ExecutorInterface ::: -:::{php:interface} JsExecutorInterface +:::{php:interface} UserAction\JsExecutorInterface ::: ## Basic Executor -:::{php:class} BasicExecutor +:::{php:class} UserAction\BasicExecutor ::: This is the base view for most of the other action executors. This executor generally @@ -40,7 +40,7 @@ BasicExecutor will display: ## Preview Executor -:::{php:class} PreviewExecutor +:::{php:class} UserAction\PreviewExecutor ::: This executor is specifically set in order to display the $preview property of the current model UserAction. @@ -48,7 +48,7 @@ You can select to display the preview using regular console type container, regu ## Form Executor -:::{php:class} FormExecutor +:::{php:class} UserAction\FormExecutor ::: This executor will display a form where user is required to fill in either all model fields or certain model fields @@ -56,7 +56,7 @@ depending on the model UserAction $field property. Form control will depend on m ## Argument Form Executor -:::{php:class} ArgumentFormExecutor +:::{php:class} UserAction\ArgumentFormExecutor ::: This executor will display a form but instead of filling form control with model field, it will use model UserAction @@ -65,7 +65,7 @@ The type of form control type to be used in form will depend on how $args is set ## JS Callaback Executor -:::{php:class} JsCallbackExecutor +:::{php:class} UserAction\JsCallbackExecutor ::: This type of executor will output proper javascript that you can assign to a view event using View::on() method. @@ -73,7 +73,7 @@ It is also possible to pass the UserAction argument via $_POST argument. ## Modal Executor -:::{php:class} ModalExecutor +:::{php:class} UserAction\ModalExecutor ::: The ModalExecutor is base on Modal view. This is a one size fits all for model UserAction. When setting the UserAction via the @@ -93,7 +93,7 @@ Modal::$title property. ## Confirmation Executor -:::{php:class} ConfirmationExecutor +:::{php:class} UserAction\ConfirmationExecutor ::: Like ModalExecutor, Confirmation executor is also based on a Modal view. It allow to display UserAction::confirmation property prior to @@ -129,7 +129,7 @@ other hand, if MODIFIER_UPDATE is set, then Table needs to be reloaded. ## The Executor Factory -:::{php:class} ExecutorFactory +:::{php:class} UserAction\ExecutorFactory ::: :::{php:attr} executorSeed diff --git a/docs/fileupload.md b/docs/fileupload.md index 792a28193a..0adfb834bf 100644 --- a/docs/fileupload.md +++ b/docs/fileupload.md @@ -14,7 +14,7 @@ in steps: 1. User arrives at the page with a form 2. User selects file. 3. File begins uploading. -4. PHP upload callback {php:meth}`Upload::onUpload` is called, returns "file_id" +4. PHP upload callback {php:meth}`Form\Control\Upload::onUpload` is called, returns "file_id" 5. "file_id" is placed inside form. 6. User submits the form 7. {php:meth}`\Atk4\Ui\Form::onSubmit()` receives "file_id" @@ -24,10 +24,7 @@ it can be removed. Both Upload and UploadImage controls contain an upload button open a File Selection dialog. UploadImage also implements image preview icon. During upload, a progress bar will appear. -:::{php:namespace} Atk4\Ui\Form\Control -::: - -:::{php:class} Upload +:::{php:class} Form\Control\Upload ::: ## Attributes @@ -137,7 +134,7 @@ $img->onDelete(function (string $fileId) use ($img) { Similar to Upload, this is a control implementation for uploading images. Here are additional properties: -:::{php:class} UploadImage +:::{php:class} Form\Control\UploadImage ::: UploadImage form control inherits all of the Upload properties plus these ones: diff --git a/docs/form-control.md b/docs/form-control.md index 4805bf8ad1..ae61e73778 100644 --- a/docs/form-control.md +++ b/docs/form-control.md @@ -1,11 +1,11 @@ -:::{php:namespace} Atk4\Ui\Form +:::{php:namespace} Atk4\Ui ::: (form-control)= # Form Controls -:::{php:class} Control +:::{php:class} Form\Control ::: Agile UI dedicates a separate namespace for the Form Controls. Those are @@ -195,9 +195,9 @@ Form Control Decorator. The rules are rather straightforward but may change in future versions of Agile UI: -- if [enum](https://agile-data.readthedocs.io/en/develop/fields.html#Field::$enum) is defined, use {php:class}`Dropdown` +- if [enum](https://agile-data.readthedocs.io/en/develop/fields.html#Field::$enum) is defined, use {php:class}`Form\Control\Dropdown` - consult {php:attr}`\Atk4\Ui\Form::$typeToDecorator` property for type-to-seed association -- type=password will use {php:class}`Password` +- type=password will use {php:class}`Form\Control\Password` You always have an option to explicitly specify which field you would like to use: @@ -226,12 +226,9 @@ will be linked with Model Fields. Form decorator defines $field property which will be pointing to a field object of a model, so technically the value of the field would be read from `$decorator->entityField->get()`. -:::{php:namespace} Atk4\Ui\Form\Control -::: - ## Line Input Form control -:::{php:class} Input +:::{php:class} Form\Control\Input Implements View for presenting Input form controls. Based around https://fomantic-ui.com/elements/input.html. ::: @@ -308,7 +305,7 @@ To see various examples of form controls and their attributes see `demos/form-co ### Integration with Form -When you use {php:class}`form::addControl()` it will create 'Form Control Decorator' +When you use {php:class}`Form::addControl()` it will create 'Form Control Decorator' ### JavaScript on Input @@ -348,7 +345,7 @@ $c1->onChange(\Atk4\Ui\Js\JsExpression('console.log(\'c1 changed: \' + date + \' ## Dropdown -:::{php:class} Dropdown +:::{php:class} Form\Control\Dropdown ::: Dropdown uses Fomantic-UI Dropdown (https://fomantic-ui.com/modules/dropdown.html). A Dropdown can be used in two ways: @@ -357,10 +354,10 @@ Dropdown uses Fomantic-UI Dropdown (https://fomantic-ui.com/modules/dropdown.htm ### Usage with a Model -A Dropdown is not used as default Form Control decorator (`$model->hasOne()` uses {php:class}`Lookup`), but in your Model, you can define that +A Dropdown is not used as default Form Control decorator (`$model->hasOne()` uses {php:class}`Form\Control\Lookup`), but in your Model, you can define that UI should render a Field as Dropdown. For example, this makes sense when a `hasOne()` relationship only has a very limited amount (like 20) of records to display. Dropdown renders all records when the paged is rendered, while Lookup always sends an additional request to the server. -{php:class}`Lookup` on the other hand is the better choice if there is lots of records (like more than 50). +{php:class}`Form\Control\Lookup` on the other hand is the better choice if there is lots of records (like more than 50). To render a model field as Dropdown, use the ui property of the field: @@ -519,7 +516,7 @@ $this->addField('expressions', [ ## DropdownCascade -:::{php:class} DropdownCascade +:::{php:class} Form\Control\DropdownCascade ::: DropdownCascade input are extend from Dropdown input. They rely on `cascadeFrom` and `reference` property. @@ -551,7 +548,7 @@ $form->addControl('product_id', [DropdownCascade::class, 'cascadeFrom' => 'sub_c ## Lookup -:::{php:class} Lookup +:::{php:class} Form\Control\Lookup ::: Lookup input is also based on Fomantic-UI dropdown module but with ability to dynamically request server for data it's diff --git a/docs/js.md b/docs/js.md index 7e7c9d300c..3d37ef2eba 100644 --- a/docs/js.md +++ b/docs/js.md @@ -1,4 +1,4 @@ -:::{php:namespace} Atk4\Ui\Js +:::{php:namespace} Atk4\Ui ::: (js)= @@ -40,7 +40,7 @@ the code for hiding a view can be generated by calling: $action = $view->js()->hide(); ``` -There are other ways to generate an action, such as using {php:meth}`JsExpression`: +There are other ways to generate an action, such as using {php:class}`JsExpression`: ``` $action = new JsExpression('alert([])', ['Hello world']); @@ -141,7 +141,7 @@ for details. ## Building actions with JsExpressionable -:::{php:interface} JsExpressionable +:::{php:interface} Js\JsExpressionable Allow objects of the class implementing this interface to participate in building JavaScript expressions. ::: @@ -166,7 +166,7 @@ $('#button-id').appendTo('#frame-id'); ### JavaScript Chain Building -:::{php:class} JsChain +:::{php:class} Js\JsChain Base class JsChain can be extended by other classes such as Jquery to provide transparent mappers for any JavaScript framework. ::: @@ -181,7 +181,7 @@ $chain = new Jquery('#the-box-id'); $chain->dropdown(); ``` -The calls to the chain are stored in the object and can be converted into JavaScript by calling {php:meth}`JsChain::jsRender()` +The calls to the chain are stored in the object and can be converted into JavaScript by calling {php:meth}`Js\JsChain::jsRender()` :::{php:method} jsRender() Converts actions recorded in JsChain into string of JavaScript code. @@ -207,9 +207,9 @@ JavaScript binding and also decides which actions should be available while crea :::{php:method} _jsEncode JsChain will map all the other methods into JS counterparts while encoding all the arguments using `_jsEncode()`. Although similar to the standard JSON encode function, this method quotes strings using single quotes -and recognizes {php:interface}`JsExpressionable` objects and will substitute them with the result of -{php:meth}`JsExpressionable::jsRender`. The result will not be escaped and any object implementing -{php:interface}`JsExpressionable` interface is responsible for safe JavaScript generation. +and recognizes {php:interface}`Js\JsExpressionable` objects and will substitute them with the result of +{php:meth}`Js\JsExpressionable::jsRender`. The result will not be escaped and any object implementing +{php:interface}`Js\JsExpressionable` interface is responsible for safe JavaScript generation. ::: The following code is safe: @@ -297,7 +297,7 @@ $buttons->on('click', '.button', $b3->js()->hide()); ## JsExpression -:::{php:class} JsExpression +:::{php:class} Js\JsExpression ::: :::{php:method} __construct(template, args) @@ -313,7 +313,7 @@ $action = new JsExpression('alert([])', [ ]); ``` -Because {php:class}`JsChain` will typically wrap all the arguments through +Because {php:class}`Js\JsChain` will typically wrap all the arguments through {php:meth}`JsChain::_jsonEncode()`, it prevents you from accidentally injecting JavaScript code: ``` @@ -429,7 +429,7 @@ There are two modal implementations in ATK: - View - Modal: This works with a pre-existing Div, shows it and can be populated with contents; - JsModal: This creates an entirely new modal Div and then populates it. -In contrast to {php:class}`Modal`, the HTML `