PHP Classes

PHP Modal Box: Display modal boxes using Bootstrap

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 260 This week: 1All time: 7,805 This week: 560Up
Version License PHP version Categories
bs4_modal_class 1.0.0Freely Distributable5HTML, PHP 5
Description 

Author

This class can be used to display modal boxes using Bootstrap.

It can generate HTML using Bootstrap CSS styles to display modal dialogs using given content.

The class can be configured to set the HTML content for the title, body, footer, animation type, close button, etc..

Picture of muneeb aslam
  Performance   Level  
Name: muneeb aslam <contact>
Classes: 1 package by
Country: Pakistan Pakistan
Age: ???
All time rank: 394549 in Pakistan Pakistan
Week rank: 411 Up9 in Pakistan Pakistan Up

Recommendations

What is the best PHP modal submit form remains opened class?
Make a modal popup that will not close after submit

Example

<?php
    $varName
= new ModalBox;
   
   
//lets first set the modal id
   
$varName->setId('modal_id');
   
   
//Set the title of to be used in header (optional)
   
$varName->setTitle("modal title");
   
   
// Set the body content of the modal
   
$varName->setBodyContent("modal body content");
   
   
// Set the footer of the modal (optional)
   
$varName->setFooterContent("modal footer content");
   
   
//--------
    // Finally initiate the function to build the modal
    // This function has the following 6 arguments
    // 1. Modal Animation Type: fade etc. Put 'false' in single quotes to disable it
    // 2. Modal Header display Option. Boolean (true/ false)
    // 3. Modal Header Title display Option. Boolean (true/ false)
    // 4. Modal Close X on top Option. Boolean (true/ false)
    // 5. Modal Footer Display Option. Boolean (true/ false)
    // 6. Modal Footer close button display Option. Boolean (true/ false)
    //
    // The following parameters will add a modal of fade animation with everything (header, title, buttons footer etc) displayed
   
   
$varName->initiateModal('fade',true,true,true,true,true);
   
   
// NOTE: You will manualy need to add a button bound to this modal and add data-target as modal id.
?>


  Files folder image Files  
File Role Description
Plain text file bs4_modal_class.php Class Add a bs modal anywhere without writing the whole code
Accessible without login Plain text file Usage.php Example How to use the class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:260
This week:1
All time:7,805
This week:560Up