Sets the JavaScript class controller - if you need to register an extra event listeners (show, shown, hide, hidden) or logic.
Sets the title of a dialog.
Sets the body of a dialog.
Sets the footer of a dialog.
Sets the whole content of a dialog.
Close all opened dialogs.
Close only current dialog.
Render defined dialog.
namespace App\Http\Controllers;
class DialogController extends Controller
{
public function __construct(DialogResponse $response)
{
$this->response = $response;
}
public function showModal()
{
$this->response
->setTitle('Dialog title')
->setBody('HTML body')
->setFooter('HTML footer')
->dialog();
// or
$this->response
->setDialog('HTML content')
->dialog([
'backdrop' => 'static',
]);
return $this->response->send();
}
}
We use the Modal Vanilla dependency to display dialogs which is functionally and visually compatible with Bootstrap framework.