Download the PHP package jaxon-php/jaxon-dialogs without Composer

On this page you can find all versions of the php package jaxon-php/jaxon-dialogs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jaxon-dialogs

Build Status Scrutinizer Code Quality StyleCI codecov

Latest Stable Version Total Downloads Latest Unstable Version License

Dialogs for Jaxon

Modals, alerts and confirmation dialogs for Jaxon with various javascript libraries.

Features

This package provides modal, alert and confirmation dialogs to Jaxon applications with various javascript libraries. 12 libraries are currently supported.

The 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.

The URL and version number can be set individually for each javascript library.

Installation

Add the following lines in the composer.json file, and run the composer update command.

Configuration

This package defines 3 config options in the app.dialogs.default section to set the default library to be used.

The app.dialogs.confirm section defines options for the confirm dialog.

The app.dialogs.lib.use option allows to load additional libraries into the page, if they are used in the application.

The app.dialogs.lib.uri option defines the URI where to download the libraries files from.

Specific options can also be set for each library.

Usage

Modal dialogs

This plugin provides functions to show and hide modal dialogs, with a title, a content and zero or more buttons.

The parameters of the show() methods are described as follow:

Example.

Alerts or notifications

This plugin provides functions to show 4 different types of alerts or notification messages.

Example.

Confirmation question

The 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.

The first parameter, which is mandatory, is the question to ask.

The 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. They are specially useful when pieces of information from the web page need to be inserted in translated strings.

In the example below, the user has to choose a color, and the selected color is inserted in the confirmation question.

Example with Jaxon selector.

Example with jQuery selector.

Supported libraries

This package currently supports the following javascript libraries, each implementing one or more interfaces.

Alertify

https://alertifyjs.com/

Bootbox

https://bootboxjs.com/

Bootstrap 5

https://getbootstrap.com/docs/5.2/components/modal/

Bootstrap 4

https://getbootstrap.com/docs/4.0/components/modal/

Bootstrap 3

https://nakupanda.github.io/bootstrap3-dialog/

Butterup

https://butteruptoast.com

CuteAlert

https://github.com/gustavosmanc/cute-alert/

IziToast

https://marcelodolza.github.io/iziToast/

jAlert

https://htmlguyllc.github.io/jAlert/

JQuery-Confirm

https://craftpip.github.io/jquery-confirm/

Notify

https://notifyjs.jpillora.com/

Noty

https://ned.im/noty/

Notyf

https://carlosroso.com/notyf/

Quantum

https://quantumalert.cosmogic.com/

Sweet Alert

Sweet Alert: https://sweetalert.js.org/

Tingle

https://tingle.robinparisi.com/

Toastr

https://codeseven.github.io/toastr/

Adding a new library

Adding a new javascript library to the Dialogs plugin requires to provides some javascript and PHP code. Depending on the features in the library, the javascript code needs to implement functions to show dialog windows, alert messages or confirm questions. The required PHP class only implements functions to load the javascript code into the web page.

The javascript code

The jaxon.dialog.register() function of the Jaxon javascript library registers a new dialog library into the web application. It must be provided with the dialog library unique name and a callback returning a javascript object with one or more of the above functions.

The cbDomElement callback is very important. The Jaxon library needs to parse any HTML code inserted in the page, in order to process its custom attributes. This callback does that, and thus needs to be provided with the root HTML element inserted in the page when showing the dialog window.

Note: the js/ dir in this repo contains the javascript codes for the already supported dialog libraries.

The abstract PHP class

The PHP class must extend the Jaxon\Dialogs\Dialog\AbstractLibrary abstract class, and implement at least one of the Jaxon\App\Dialog\Library\AlertInterface, Jaxon\App\Dialog\Library\ConfirmInterface, or Jaxon\App\Dialog\Library\ModalInterface interfaces, depending on the features it provides.

The Jaxon\Dialogs\Dialog\AbstractLibrary abstract class implements the Jaxon\Dialogs\Dialog\LibraryInterface interface, and provides default implementations for the methods it defines.

The public function getName(): string method returns the unique name of the dialog library. It will namely be used in the config options to identify the library.

The public function getBaseUrl(): string method returns a base URL for the library javascript and CSS files. The public function helper() returns a helper which implements defaults for the class functions. These two methods are not part of the Jaxon\Dialogs\Dialog\LibraryInterface interface.

The public function getCssUrls(): array method returns an array of URLs to the library CSS files. Its default implementation returns the values in the protected $aCssFiles property, prefixed with the getBaseUrl() value.

The public function getCssCode(): string method returns raw CSS code for the dialog library, without the <style> tag. Its default implementation returns an empty string.

The public function getJsUrls(): array method returns an array of URLs to the library javascript files. Its default implementation returns the values in the protected $aJsFiles property, prefixed with the getBaseUrl() value.

The public function getJsCode(): string method returns raw javascript code for the dialog library, without the <script> tag. Its default implementation returns the content of the dialog library file in the js/ dir in the repository.

The public function getJsOptions(): array method returns an array of custom javascript options for the dialog library. Its default implementation returns the values defined in the Dialogs plugin options, as decribed above.

The other interfaces

Depending on the javascript library features, the class must implement one or more of the following three interfaces. These interfaces are empty, and thay just give an indication of which features are implemented by the library.

For windows and modal dialogs.

For notifications alerts.

For confirmation questions.

Helper

The Jaxon\App\Dialog\Library\AbstractDialogLibrary base class provides default implementations for some methods of the Jaxon\App\Dialog\Library\LibraryInterface interface, as well as a Jaxon\App\Dialog\Library\DialogLibraryHelper object, returned by the helper() method, which gives access to the dialog config options, and templates.

Registration

After it is defined, the library class needs to be configured and registered before it can be used in the application.

The class can be registered when starting the library.

Or declared in the dialog section of the Jaxon configuration.

Contribute

License

The package is licensed under the BSD license.


All versions of jaxon-dialogs with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
jaxon-php/jaxon-core Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jaxon-php/jaxon-dialogs contains the following files

Loading the files please wait ...