src/Popup.php
public function set($fx = null, $arg2 = null)
    {
        if (!is_object($fx) && !($fx instanceof Closure)) {
            throw new Exception('Error: Need to pass a function to Popup::set()');
        }

        if ($arg2) {
            throw new Exception('Only one argument is needed by Popup::set()');
        }

        $this->cb = $this->add('Callback');

        if (!$this->minWidth) {
            $this->minWidth = '120px';
        }

        if (!$this->minHeight) {
            $this->minHeight = '60px';
        }

        if ($this->cb->triggered()) {
            //create content view to pass to callback.
            $content = $this->add($this->dynamicContent);
            $this->cb->set($fx, [$content]);
            //only render our content view.
            //PopupService will replace content with this one.
            $this->app->terminate($content->renderJSON());
        }
    }
public function set($fx = null, $arg2 = null)
    {
        if (!is_object($fx) && !($fx instanceof Closure)) {
            throw new Exception('Error: Need to pass a function to Popup::set()');
        }

        if ($arg2) {
            throw new Exception('Only one argument is needed by Popup::set()');
        }

        $this->cb = $this->add('Callback');

        if (!$this->minWidth) {
            $this->minWidth = '120px';
        }

        if (!$this->minHeight) {
            $this->minHeight = '60px';
        }

        if ($this->cb->triggered()) {
            //create content view to pass to callback.
            $content = $this->add($this->dynamicContent);
            $this->cb->set($fx, [$content]);
            //only render our content view.
            //PopupService will replace content with this one.
            $this->app->terminate($content->renderJSON());
        }
    }
public function set ( $ fx = null , $ arg2 = null ) { if ( ! is_object ( $ fx ) && ! ( $ fx instanceof Closure ) ) { throw new Exception ( 'Error: Need to pass a function to Popup::set()' ) ; } if ( $ arg2 ) { throw new Exception ( 'Only one argument is needed by Popup::set()' ) ; } $ this -> cb = $ this -> add ( 'Callback' ) ; if ( ! $ this -> minWidth ) { $ this -> minWidth = '120px' ; } if ( ! $ this -> minHeight ) { $ this -> minHeight = '60px' ; } if ( $ this -> cb -> triggered ( ) ) { //create content view to pass to callback. $ content = $ this -> add ( $ this -> dynamicContent ) ; $ this -> cb -> set ( $ fx , [ $ content ] ) ; //only render our content view. //PopupService will replace content with this one. $ this -> app -> terminate ( $ content -> renderJSON ( ) ) ; } }
Set callback for loading content dynamically.
Callback will reveive a view attach to this popup
for adding content to it.

@param $fx

@throws Exception
Set callback for loading content dynamically . Callback will reveive a view attach to this popup for adding content to it .