PHPDialog is a library to facilitate rapid server-side GUI development by generating dialog-like HTML documents with just a single function.
Why? - well, because many boring interactions like confirmations,
logins, password resets, warnings and notifications can be solved by
just a dialog. This means you save time (and money)
and you can focus on the real application instead.
Dialogs can
reduce webapp logic up to 40%!
Dialog::show( 'Notice', 'Mind the gap!' );
Features:
- create a fully customizable dialog with just 1 function
- 0 dependencies, just one file (all-in, even css)
- no Javascript required
- works on mobile
- neutral default look
You can download PHPDialog v 1.0 here or get the source.
Examples
This is how it looks by default:
with a single line of css:
Usage
This is how you use it:
Alert: Dialog::show( $title, $message ) for instance: Dialog::show( 'Notice', 'Mind the gap!' ); Confirm: Dialog::render( .., .., ['no'=>'/'], ['yes'=>'/go'] ); Prompt: Dialog::render( .., .., [], ['ok'=>'/go'], ['name'=>'me', 'type'=>'text'] ); 'Promptfirm': Dialog::render( .., .., ['no'=>'/'], ['yes'=>'/yes'], [ ..fields.. ] ); Custom: Dialog::render( some other combination );
Theming
To change the appearance of your dialogs:
Use your own colors: Dialog::colors( $background, $foreground, $text ); Use your own fonts: Dialog::theme( $textFont, $headerFont ); Override styles: Dialog::css( $customCss ); Use your own template: Dialog::setTemplate( $customTemplate);