Modal Object

Parameters

  • identifier = string
  • modal_title = string, default ”
  • attributes = array()

new ModalObject( $identifier, $modal_title, $attributes );

Functions

  • add_subelement_to_body ( $object )
  • add_subelement_to_footer ( $object )
  • add_modal_submit_button ($attributes, $text );
  • add_modal_submit_button ($attributes, $text );
  • add_modal_button ($attributes, $text );
  • get_identifier()

Usage

$modal = new ModalObject("modal_identifier", "my modal");

echo $modal->get_template();

Output

<div class="modal-content" id="my_id">
  <div class="modal-header ui-draggable-handle" id="my_id_modal_header">
    <h5 class="modal-title" id="my_id_modal_title">Upload File</h5>
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
      <span aria-hidden="true">x</span>
    </button>
  </div>
  
  <div class="modal-body" id="my_id_modal_body">
     <!--- inner content --->  
  </div>
</div>