{"id":20934475,"url":"https://github.com/jaxon-php/jaxon-dialogs","last_synced_at":"2026-01-02T04:45:26.172Z","repository":{"id":14489718,"uuid":"76621357","full_name":"jaxon-php/jaxon-dialogs","owner":"jaxon-php","description":"Modal, alerts and confirmation dialogs for Jaxon with various javascript libraries https://www.jaxon-php.org.","archived":false,"fork":false,"pushed_at":"2025-07-22T12:42:55.000Z","size":444,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-22T14:40:05.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaxon-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-16T04:30:00.000Z","updated_at":"2025-07-22T12:36:19.000Z","dependencies_parsed_at":"2023-11-20T06:27:52.721Z","dependency_job_id":"2adc4eb0-86a2-43a1-aa15-f2ecacd6dcb2","html_url":"https://github.com/jaxon-php/jaxon-dialogs","commit_stats":{"total_commits":129,"total_committers":2,"mean_commits":64.5,"dds":0.007751937984496138,"last_synced_commit":"e5411f8020da96ca42bde4a4965826b508efb7df"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/jaxon-php/jaxon-dialogs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-dialogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-dialogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-dialogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-dialogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaxon-php","download_url":"https://codeload.github.com/jaxon-php/jaxon-dialogs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-dialogs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272335792,"owners_count":24916529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T22:09:29.906Z","updated_at":"2025-12-26T02:58:47.388Z","avatar_url":"https://github.com/jaxon-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/jaxon-php/jaxon-dialogs/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/jaxon-php/jaxon-dialogs/actions)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jaxon-php/jaxon-dialogs/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/jaxon-php/jaxon-dialogs/?branch=main)\n[![StyleCI](https://styleci.io/repos/60390067/shield?branch=main)](https://styleci.io/repos/60390067)\n[![codecov](https://codecov.io/gh/jaxon-php/jaxon-dialogs/branch/main/graph/badge.svg?token=MKqDVnW7eJ)](https://codecov.io/gh/jaxon-php/jaxon-dialogs)\n\n[![Latest Stable Version](https://poser.pugx.org/jaxon-php/jaxon-dialogs/v/stable)](https://packagist.org/packages/jaxon-php/jaxon-dialogs)\n[![Total Downloads](https://poser.pugx.org/jaxon-php/jaxon-dialogs/downloads)](https://packagist.org/packages/jaxon-php/jaxon-dialogs)\n[![Latest Unstable Version](https://poser.pugx.org/jaxon-php/jaxon-dialogs/v/unstable)](https://packagist.org/packages/jaxon-php/jaxon-dialogs)\n[![License](https://poser.pugx.org/jaxon-php/jaxon-dialogs/license)](https://packagist.org/packages/jaxon-php/jaxon-dialogs)\n\nDialogs for Jaxon\n=================\n\nModals, alerts and confirmation dialogs for Jaxon with various javascript libraries.\n\n\nFeatures\n--------\n\nThis package provides modal, alert and confirmation dialogs to Jaxon applications with various javascript libraries.\n12 libraries are currently supported.\n\nThe javascript library to use for each function is chosen by configuration, and the package takes care of loading the library files into the page and generating the javascript code.\n\nThe URL and version number can be set individually for each javascript library.\n\nInstallation\n------------\n\nAdd the following lines in the `composer.json` file, and run the `composer update` command.\n\n```json\n\"require\": {\n    \"jaxon-php/jaxon-core\": \"^5.3\",\n    \"jaxon-php/jaxon-dialogs\": \"^5.1\"\n}\n```\n\nConfiguration\n-------------\n\nThis package defines 3 config options in the `default` section to set the default library to be used.\n- modal: the default library for modal dialogs\n- alert: the default library for alerts\n- confirm: the default library for questions\n\nThe `lib.use` option allows to load additional libraries into the page, if they are used in the application.\n\nThe `confirm` section defines options for the confirm dialog.\n\nThe `lib.uri` option defines the URI where to download the libraries files from.\n\nSpecific options can also be set for each library.\n\n```php\n    'dialogs' =\u003e [\n        'default' =\u003e [\n            'modal' =\u003e 'bootstrap',  // Default library for modal dialogs\n            'alert' =\u003e 'jconfirm', // Default library for alerts\n            'confirm' =\u003e 'noty',    // Default library for questions\n        ],\n        'lib' =\u003e [\n            'uri' =\u003e 'https://cdn.jaxon-php.org/libs',\n            'use' =\u003e ['cute', 'toastr'], // Additional libraries in use\n        ],\n        // Confirm options\n        'confirm' =\u003e [\n            'title' =\u003e 'Confirm',   // The confirm dialog\n            'yes' =\u003e 'Oh Yes',       // The text of the Yes button\n            'no' =\u003e 'No way',        // The text of the No button\n        ],\n        // Options for the Toastr library\n        'toastr' =\u003e [\n            'options' =\u003e [\n                'closeButton' =\u003e true,\n                'positionClass' =\u003e 'toast-top-center'\n            ],\n        ],\n        // Load a different version of the JQuery Confirm library from a different CDN\n        'jconfirm' =\u003e [\n            'uri' =\u003e 'https://cdnjs.cloudflare.com/ajax/libs',\n            'subdir' =\u003e 'jquery-confirm',\n            'version' =\u003e '3.3.2',\n        ],\n    ],\n```\n\nUsage\n-----\n\n### Modal dialogs\n\nThis plugin provides functions to show and hide modal dialogs, with a title, a content and zero or more buttons.\n\n```php\n/**\n * Show a modal dialog.\n */\npublic function show($title, $content, array $buttons, array $options = []);\n\n/**\n * Hide the modal dialog.\n */\npublic function hide();\n```\n\nThe parameters of the `show()` methods are described as follow:\n\n- `$title`: is a one line text to be printed at the top of the dialog.\n- `$content`: the HTML content of the dialog.\n- `$buttons`: a list of buttons to be printed in the dialog. Each button is an array with the following entries:\n  - `title`: the text to be printed in the button.\n  - `class`: the CSS class or classes to be applied on the button.\n  - `click`: the javascript code to be executed on a click on this button. It can be defined using the [Call Factory](https://www.jaxon-php.org/docs/v5x/ui-features/call-factories.html), or it can be set to `close` to close the dialog.\n- `$options`: an array of config options that are specific to the javascript library in use.\n\nExample.\n\n```php\n    public function showDialog()\n    {\n        // The dialog buttons\n        $buttons = [\n            [\n                'title' =\u003e 'Close',\n                'class' =\u003e 'btn',\n                'click' =\u003e 'close'\n            ]\n        ];\n        // The HTML content of the dialog\n        $content = \"This modal dialog depends on application settings!!\";\n        // The dialog specific options\n        $options = ['width' =\u003e 500];\n        // Show the dialog\n        $this-\u003eresponse-\u003edialog-\u003eshow(\"Modal Dialog\", $content, $buttons, $options);\n    }\n```\n\n### Alerts or notifications\n\nThis plugin provides functions to show 4 different types of alerts or notification messages.\n\n```php\n/**\n * Print a success message.\n */\npublic function success($message, $title = null);\n\n/**\n * Print an information message.\n */\npublic function info($message, $title = null);\n\n/**\n * Print a warning message.\n */\npublic function warning($message, $title = null);\n\n/**\n * Print an error message.\n */\npublic function error($message, $title = null);\n```\n\nExample.\n\n```php\n    public function save($formValues)\n    {\n        if(!$this-\u003evalidator-\u003evalid($formValues))\n        {\n            $this-\u003eresponse-\u003edialog-\u003etitle(\"Error\")-\u003eerror(\"Invalid input\");\n            return;\n        }\n        $this-\u003erepository-\u003esave($formValues);\n        $this-\u003eresponse-\u003edialog-\u003etitle(\"Success\")-\u003esuccess(\"Data saved!\");\n    }\n```\n\n### Confirmation question\n\nThe `confirm()` function adds a confirmation question to a Jaxon request, which will then be called only if the user answers yes to the given question.\n\n```php\n/**\n * Add a confirmation question to the request\n */\npublic function confirm($question, ...);\n```\n\nThe first parameter, which is mandatory, is the question to ask.\n\nThe next parameters are optional; they allow the insertion of content from the web page in the confirmation question, using Jaxon or jQuery selectors and positional placeholders.\nThey are specially useful when pieces of information from the web page need to be inserted in translated strings.\n\nIn the example below, the user has to choose a color, and the selected color is inserted in the confirmation question.\n\nExample with Jaxon selector.\n\n```php\n\u003cselect class=\"form-control\" id=\"colorselect\" name=\"colorselect\" onchange=\"\u003c?php\n    echo rq('HelloWorld')-\u003esetColor(pm()-\u003eselect('colorselect'))\n        -\u003econfirm('Set color to {1}?', pm()-\u003eselect('colorselect')) ?\u003e; return false;\"\u003e\n    \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\n    \u003coption value=\"red\"\u003eRed\u003c/option\u003e\n    \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\n    \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\n\u003c/select\u003e\n```\n\nExample with jQuery selector.\n\n```php\n\u003cselect class=\"form-control\" id=\"colorselect\" name=\"colorselect\" onchange=\"\u003c?php\n    echo rq('HelloWorld')-\u003esetColor(jq('#colorselect')-\u003eval())\n        -\u003econfirm('Set color to {1}?', jq('#colorselect')-\u003eval()) ?\u003e; return false;\"\u003e\n    \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\n    \u003coption value=\"red\"\u003eRed\u003c/option\u003e\n    \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\n    \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\n\u003c/select\u003e\n```\n\nSupported libraries\n-------------------\n\nThis package currently supports the following javascript libraries, each implementing one or more interfaces.\n\n#### Alertify\n\nhttps://alertifyjs.com/\n\n- Dialog id: alertify\n- Implements: Modal, Alert, Confirm\n- Version: 1.14.0\n\n#### Bootbox\n\nhttps://bootboxjs.com/\n\n- Dialog id: bootbox\n- Implements: Modal, Alert, Confirm\n- Version: 6.0.0\n\n#### Bootstrap 5\n\nhttps://getbootstrap.com/docs/5.2/components/modal/\n\n- Dialog id: bootstrap5\n- Implements: Modal\n\n#### Bootstrap 4\n\nhttps://getbootstrap.com/docs/4.0/components/modal/\n\n- Dialog id: bootstrap4\n- Implements: Modal\n\n#### Bootstrap 3\n\nhttps://nakupanda.github.io/bootstrap3-dialog/\n\n- Dialog id: bootstrap3\n- Implements: Modal, Alert, Confirm\n- Version: 1.35.4\n\n#### Butterup\n\nhttps://butteruptoast.com\n\n- Dialog id: butterup\n- Implements: Alert, Confirm\n\n#### CuteAlert\n\nhttps://github.com/gustavosmanc/cute-alert/\n\n- Dialog id: cute\n- Implements: Alert, Confirm\n\n#### IziToast\n\nhttps://marcelodolza.github.io/iziToast/\n\n- Dialog id: izitoast\n- Implements: Alert, Confirm\n\n#### jAlert\n\nhttps://htmlguyllc.github.io/jAlert/\n\n- Dialog id: jalert\n- Implements: Alert, Confirm\n- Version: 4.9.1\n\n#### JQuery-Confirm\n\nhttps://craftpip.github.io/jquery-confirm/\n\n- Dialog id: jconfirm\n- Implements: Modal, Alert, Confirm\n- Version: 3.3.4\n\n#### Notify\n\nhttps://notifyjs.jpillora.com/\n\n- Dialog id: notify\n- Implements: Alert\n- Versions: 0.4.1\n\n#### Noty\n\nhttps://ned.im/noty/\n\n- Dialog id: noty\n- Implements: Alert, Confirm\n- Version: 3.1.4\n\n#### Notyf\n\nhttps://carlosroso.com/notyf/\n\n- Dialog id: notyf\n- Implements: Alert, Confirm\n\n#### Quantum\n\nhttps://quantumalert.cosmogic.com/\n\n- Dialog id: quantum\n- Implements: Alert, Confirm\n\n#### Sweet Alert\n\nSweet Alert: https://sweetalert.js.org/\n\n- Dialog id: sweetalert\n- Implements: Alert, Confirm\n- Version: 2.1.2\n\n#### Tingle\n\nhttps://tingle.robinparisi.com/\n\n- Dialog id: tingle\n- Implements: Modal\n- Version: 0.16.0\n\n#### Toastr\n\nhttps://codeseven.github.io/toastr/\n\n- Dialog id: toastr\n- Implements: Alert\n- Version: 2.1.4\n\nContribute\n----------\n\n- Issue Tracker: github.com/jaxon-php/jaxon-dialogs/issues\n- Source Code: github.com/jaxon-php/jaxon-dialogs\n\nLicense\n-------\n\nThe package is licensed under the BSD license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-dialogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxon-php%2Fjaxon-dialogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-dialogs/lists"}