src/Common.php
public function alert($type, $alert, $dismissable = true)
    {
        $html = '';
        $class = 'alert alert-'.$type;
        if ($dismissable) {
            $class .= ' alert-dismissable';
        }
        $html .= '<div class="'.$class.'" role="alert">';
        if ($dismissable) {
            $html .= '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span></button>';
        }
        $html .= $this->addClass($alert, array('h([1-6]){1}' => 'alert-heading', 'a' => 'alert-link'));
        $html .= '</div>';

        return $html;
    }
public function alert($type, $alert, $dismissable = true)
    {
        $html = '';
        $class = 'alert alert-'.$type;
        if ($dismissable) {
            $class .= ' alert-dismissable';
        }
        $html .= '<div class="'.$class.'" role="alert">';
        if ($dismissable) {
            $html .= '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span></button>';
        }
        $html .= $this->addClass($alert, array('h([1-6]){1}' => 'alert-heading', 'a' => 'alert-link'));
        $html .= '</div>';

        return $html;
    }
public function alert ( $ type , $ alert , $ dismissable = true ) { $ html = '' ; $ class = 'alert alert-' . $ type ; if ( $ dismissable ) { $ class .= ' alert-dismissable' ; } $ html .= '<div class="' . $ class . '" role="alert">' ; if ( $ dismissable ) { $ html .= '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span></button>' ; } $ html .= $ this -> addClass ( $ alert , array ( 'h([1-6]){1}' => 'alert-heading' , 'a' => 'alert-link' ) ) ; $ html .= '</div>' ; return $ html ; }
Creates Bootstrap alert messages.

@param string $type        Either '**success**', '**info**', '**warning**', or '**danger**'.
@param string $alert       The status message. All ``<h1-6>`` headers and ``<a>`` links will be classed appropriately.
@param bool   $dismissable If you set this to false, then the alert will not be dismissable.

@return string

@example

```php
echo $bp->alert('info', '<h3>Heads up!</h3> This alert needs your attention, but it\'s not <a href="#">super important</a>.');

echo $bp->alert('danger', '<h3>Oh snap!</h3> Change a few things up and <a href="#">try submitting again</a>.', false);
```
Creates Bootstrap alert messages .