ZF-9053: Add Output Buffer captureStart()/End() mechanism to add jQuery Panes

Description

Something alike:


    /**
     * @var array
     */
    protected $_captureLock = false;

    /**
     * Start capturing routines to run onLoad
     *
     * @return boolean
     */
    public function addPaneCaptureStart($id, $name, array $options = array())
    {
        if ($this->_captureLock) {
            require_once 'Zend/Exception.php';
            throw new Zend_Exception('Cannot nest onLoad captures');
        }

        $this->_captureLock = array($id, $name, $options);
        return ob_start();
    }

    /**
     * Stop capturing routines to run onLoad
     *
     * @return boolean
     */
    public function addPaneCaptureEnd()
    {
        $content               = ob_get_clean();
        $this->addPane($this->_captureLock[0], $this->_captureLock[1], $content, $this->_captureLock[2]);
        $this->_captureLock = false;
        return true;
    }

Comments

No comments to display