src/View/Helper/ModalHelper.php
public function end($buttons = NULL, $options = []) {
        $res = $this->_cleanCurrent();
        if($buttons !== null) {
            $res .= $this->footer($buttons, $options);
        }
        $res .= $this->formatTemplate('modalEnd', [
            'contentEnd' => $this->formatTemplate('modalContentEnd', []),
            'dialogEnd' => $this->formatTemplate('modalDialogEnd', [])
        ]);
        return $res;
    }
public function end($buttons = NULL, $options = []) {
        $res = $this->_cleanCurrent();
        if($buttons !== null) {
            $res .= $this->footer($buttons, $options);
        }
        $res .= $this->formatTemplate('modalEnd', [
            'contentEnd' => $this->formatTemplate('modalContentEnd', []),
            'dialogEnd' => $this->formatTemplate('modalDialogEnd', [])
        ]);
        return $res;
    }
public function end ( $ buttons = NULL , $ options = [ ] ) { $ res = $ this -> _cleanCurrent ( ) ; if ( $ buttons !== null ) { $ res .= $ this -> footer ( $ buttons , $ options ) ; } $ res .= $ this -> formatTemplate ( 'modalEnd' , [ 'contentEnd' => $ this -> formatTemplate ( 'modalContentEnd' , [ ] ) , 'dialogEnd' => $ this -> formatTemplate ( 'modalDialogEnd' , [ ] ) ] ) ; return $ res ; }
Closes a modal, cleans part that have not been closed correctly and optionaly
adds a footer with buttons to the modal.

If `$buttons` is not null, the `footer()` method will be used to create the modal
footer using `$buttons` and `$options`:

```php
echo $this->Modal->end([$this->Form->button('Save'), $this->Form->button('Close')]);
```

@param array $buttons Array of buttons for the `footer()` method or `null`.
@param array $options Array of options for the `footer()` method.

@return string An HTML string containing closing tags for the modal.
Closes a modal cleans part that have not been closed correctly and optionaly adds a footer with buttons to the modal .