Skip to content
paul-vg edited this page Jun 13, 2013 · 1 revision

The SxBootstap modal view helper creates the markup for modal dialogs in Bootstrap.

<?php
echo $this->sxbModal($content);
?>

See Bootstrap docs

Explicit usage

<?php
// Place a close button in the header
echo $this->sxbModal()->setCloseButton(true);

// Put a nice title on it
echo $this->sxbModal()->setHeader('<h3>Hello,</h3>');

// Put a button in the footer
echo $this->sxbModal()->setFooter($this->sxbButton()->setLabel('I know')->primary());

// Set content explicitly
echo $this->sxbModal()->setContent("I'm a modal");

// Combine all the above
echo $this->sxbModal()
    ->setContent("I'm a modal")
    ->setFooter($this->sxbButton()->setLabel('I know')->primary());
    ->setHeader('<h3>Hello,</h3>')
    ->setCloseButton(true);

// Same, but in less code
echo $this->sxbModal(
        "I'm a modal",
        $this->sxbButton()->setLabel('I know')->primary(),
        '<h3>Hello,</h3>'
    )->setCloseButton(true);

// Data attributes
echo $this->sxbModal()
    ->setBackdrop('static')
    ->setKeyboard('false')
    ->setShow('false')
    ->setRemote('remote.html');
?>
Clone this wiki locally