src/Modal/Renderer/Bootstrap.php
public function modal(Modal\Modal $modal)
    {

        $html = '';

        // header
        if ($modal->hasCloseButton()) {
            $html .= html('button', ['type' => 'button', 'class' => 'close', 'data-dismiss' => 'modal', 'aria-label' => $modal->getCloseButtonLabel()], '<span aria-hidden="true">&times;</span>');
        }

        if ($modal->hasTitle()) {
            $html .= html('h4', ['class' => Style::MODAL_HEADER_TITLE_CLASS], $modal->getTitle());
            $html = html('div', ['class' => Style::MODAL_HEADER_CLASS], $html);
        }

        // body
        $html .= html('div', ['class' => Style::MODAL_BODY_CLASS], $modal->getBody());

        // footer
        if ($modal->hasActions()) {

            $actions = '';

            if ($modal->hasCloseButton()) {
                $actions .= html('button', ['type' => 'button', 'class' => 'btn btn-default', 'data-dismiss' => 'modal'], $modal->getCloseButtonLabel());
            }

            foreach ($modal->getActions() as $action) {
                /** @var Element\Button $action */
                $actions .= $this->render('action', $action);
            }

            $html .= html('div', ['class' => Style::MODAL_FOOTER_CLASS], $actions);
        }

        // container
        if (!$modal->isRemote()) {
            $html = html('div', ['class' => Style::MODAL_CONTENT_CLASS, ], $html);
            $html = html('div', ['class' => Style::MODAL_DIALOG_CLASS, 'role' => 'document'], $html);
            $html = html('div', ['class' => Style::MODAL_CLASS,'role' => 'dialog'], $html);
        }

        $html .= html('script', ['type' => 'text/javascript'],js('onload'));

        return $html;
    }
public function modal(Modal\Modal $modal)
    {

        $html = '';

        // header
        if ($modal->hasCloseButton()) {
            $html .= html('button', ['type' => 'button', 'class' => 'close', 'data-dismiss' => 'modal', 'aria-label' => $modal->getCloseButtonLabel()], '<span aria-hidden="true">&times;</span>');
        }

        if ($modal->hasTitle()) {
            $html .= html('h4', ['class' => Style::MODAL_HEADER_TITLE_CLASS], $modal->getTitle());
            $html = html('div', ['class' => Style::MODAL_HEADER_CLASS], $html);
        }

        // body
        $html .= html('div', ['class' => Style::MODAL_BODY_CLASS], $modal->getBody());

        // footer
        if ($modal->hasActions()) {

            $actions = '';

            if ($modal->hasCloseButton()) {
                $actions .= html('button', ['type' => 'button', 'class' => 'btn btn-default', 'data-dismiss' => 'modal'], $modal->getCloseButtonLabel());
            }

            foreach ($modal->getActions() as $action) {
                /** @var Element\Button $action */
                $actions .= $this->render('action', $action);
            }

            $html .= html('div', ['class' => Style::MODAL_FOOTER_CLASS], $actions);
        }

        // container
        if (!$modal->isRemote()) {
            $html = html('div', ['class' => Style::MODAL_CONTENT_CLASS, ], $html);
            $html = html('div', ['class' => Style::MODAL_DIALOG_CLASS, 'role' => 'document'], $html);
            $html = html('div', ['class' => Style::MODAL_CLASS,'role' => 'dialog'], $html);
        }

        $html .= html('script', ['type' => 'text/javascript'],js('onload'));

        return $html;
    }
public function modal ( Modal \ Modal $ modal ) { $ html = '' ; // header if ( $ modal -> hasCloseButton ( ) ) { $ html .= html ( 'button' , [ 'type' => 'button' , 'class' => 'close' , 'data-dismiss' => 'modal' , 'aria-label' => $ modal -> getCloseButtonLabel ( ) ] , '<span aria-hidden="true">&times;</span>' ) ; } if ( $ modal -> hasTitle ( ) ) { $ html .= html ( 'h4' , [ 'class' => Style :: MODAL_HEADER_TITLE_CLASS ] , $ modal -> getTitle ( ) ) ; $ html = html ( 'div' , [ 'class' => Style :: MODAL_HEADER_CLASS ] , $ html ) ; } // body $ html .= html ( 'div' , [ 'class' => Style :: MODAL_BODY_CLASS ] , $ modal -> getBody ( ) ) ; // footer if ( $ modal -> hasActions ( ) ) { $ actions = '' ; if ( $ modal -> hasCloseButton ( ) ) { $ actions .= html ( 'button' , [ 'type' => 'button' , 'class' => 'btn btn-default' , 'data-dismiss' => 'modal' ] , $ modal -> getCloseButtonLabel ( ) ) ; } foreach ( $ modal -> getActions ( ) as $ action ) { /** @var Element\Button $action */ $ actions .= $ this -> render ( 'action' , $ action ) ; } $ html .= html ( 'div' , [ 'class' => Style :: MODAL_FOOTER_CLASS ] , $ actions ) ; } // container if ( ! $ modal -> isRemote ( ) ) { $ html = html ( 'div' , [ 'class' => Style :: MODAL_CONTENT_CLASS , ] , $ html ) ; $ html = html ( 'div' , [ 'class' => Style :: MODAL_DIALOG_CLASS , 'role' => 'document' ] , $ html ) ; $ html = html ( 'div' , [ 'class' => Style :: MODAL_CLASS , 'role' => 'dialog' ] , $ html ) ; } $ html .= html ( 'script' , [ 'type' => 'text/javascript' ] , js ( 'onload' ) ) ; return $ html ; }
Render a modal

@param \FrenchFrogs\Modal\Modal\Modal $modal
@return string
Render a modal