PHP code example of iliain / silverstripe-popup

1. Go to this page and download the library: Download iliain/silverstripe-popup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

iliain / silverstripe-popup example snippets


// necessary config
$customLink = '/PopupForms/form';
$customBodyJS = <<<JS
    // custom js goes here
JS;

// method A
PopupField::create('PopupForm', 'I am a popup', $customLink, $customBodyJS);

// method B
PopupField::create('PopupForm', 'I am a popup')
    ->setFormURL($customLink)
    ->setFormCustomCode($customBodyJS);