Skip to content
Syone edited this page Mar 6, 2025 · 1 revision

Introduction

There are 2 components in the Modal package for creating dialogs, ligthboxes, user notifications etc:

  • Modal\Dialog: The modal dialog component based on the twitter bootstrap modal component.
  • Modal\Button: The button associated with a dialog, the dialog appears when the button is pressed.

Example

<?php
use Sy\Bootstrap\Component\Modal\Button;
use Sy\Bootstrap\Component\Modal\Dialog;

// Create a modal button
$myBtn = new Button(id: 'my-modal-id', label: 'My button label', icon: 'pencil', color: 'primary', size: 'lg');

// Add something in the dialog body
$myBtn->getDialog()->setBody('Hello world');
Clone this wiki locally