src/Sked.php
public static function skeDoosh(array $aOptions)
    {
        // Load JS
        echo <<<EOD
<script>
    if (typeof jQuery == 'undefined') {
        skedLoadTag(
            'http://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js',
            loadSkedJs
        );
    } else {
         loadSkedJs();
    }

    function skedLoadTag(strSrc, fnOnload)
    {
        var eHead = document.getElementsByTagName('head')[0];
        var e$ = document.createElement('script');
        e$.src = strSrc;
        if (fnOnload)
            e$.onload = fnOnload;
        eHead.appendChild(e$);
    }

    function loadSkedJs()
    {
        skedLoadTag('https://raw.githubusercontent.com/CampusUnion/Sked-JS/master/sked.js');
    }
</script>
EOD;

        // Init Sked
        $sked = new self($aOptions);
        $skeVent = null;
        $bSuccess = false;
        if ($_REQUEST['sked_form'] ?? null === '1') {
            $skeVent = new \CampusUnion\Sked\SkeVent($_REQUEST);
            $bSuccess = $sked->save($skeVent);
        }
        echo $sked->form(['method' => 'get'], $bSuccess ?: $skeVent);
    }
public static function skeDoosh(array $aOptions)
    {
        // Load JS
        echo <<<EOD
<script>
    if (typeof jQuery == 'undefined') {
        skedLoadTag(
            'http://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js',
            loadSkedJs
        );
    } else {
         loadSkedJs();
    }

    function skedLoadTag(strSrc, fnOnload)
    {
        var eHead = document.getElementsByTagName('head')[0];
        var e$ = document.createElement('script');
        e$.src = strSrc;
        if (fnOnload)
            e$.onload = fnOnload;
        eHead.appendChild(e$);
    }

    function loadSkedJs()
    {
        skedLoadTag('https://raw.githubusercontent.com/CampusUnion/Sked-JS/master/sked.js');
    }
</script>
EOD;

        // Init Sked
        $sked = new self($aOptions);
        $skeVent = null;
        $bSuccess = false;
        if ($_REQUEST['sked_form'] ?? null === '1') {
            $skeVent = new \CampusUnion\Sked\SkeVent($_REQUEST);
            $bSuccess = $sked->save($skeVent);
        }
        echo $sked->form(['method' => 'get'], $bSuccess ?: $skeVent);
    }
public static function skeDoosh ( array $ aOptions ) { // Load JS echo  <<<EOD
<script>
    if (typeof jQuery == 'undefined') {
        skedLoadTag(
            'http://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js',
            loadSkedJs
        );
    } else {
         loadSkedJs();
    }

    function skedLoadTag(strSrc, fnOnload)
    {
        var eHead = document.getElementsByTagName('head')[0];
        var e$ = document.createElement('script');
        e$.src = strSrc;
        if (fnOnload)
            e$.onload = fnOnload;
        eHead.appendChild(e$);
    }

    function loadSkedJs()
    {
        skedLoadTag('https://raw.githubusercontent.com/CampusUnion/Sked-JS/master/sked.js');
    }
</script>
EOD ; // Init Sked $ sked = new self ( $ aOptions ) ; $ skeVent = null ; $ bSuccess = false ; if ( $ _REQUEST [ 'sked_form' ] ?? null === '1' ) { $ skeVent = new \ CampusUnion \ Sked \ SkeVent ( $ _REQUEST ) ; $ bSuccess = $ sked -> save ( $ skeVent ) ; } echo $ sked -> form ( [ 'method' => 'get' ] , $ bSuccess ? : $ skeVent ) ; }
Do it all in one easy method call.

@param array $aOptions Config options.
Do it all in one easy method call .