public function create($title = null, $options = []) {

        if(is_array($title)) {
            $options = $title;
        }

        $this->_currentId = null;
        $this->_current   = null;

        $options += [
            'id' => null,
            'close' => true,
            'body' => true,
            'size' => false,
            'templateVars' => []
        ];

        $dialogOptions = [];

        if($options['id']) {
            $this->_currentId = $options['id'];
            $options['aria-labelledby'] = $this->_currentId.'Label';
        }

        switch($options['size']) {
        case 'lg':
        case 'large':
        case 'modal-lg':
            $size = ' modal-lg';
            break;
        case 'sm':
        case 'small':
        case 'modal-sm':
            $size = ' modal-sm';
            break;
        case false:
            $size = '';
            break;
        default:
            $size = ' '.$options['size'];
            break;
        }
        $dialogOptions = $this->addClass($dialogOptions, $size);

        $dialogStart = $this->formatTemplate('modalDialogStart', [
            'attrs' => $this->templater()->formatAttributes($dialogOptions)
        ]);
        $contentStart = $this->formatTemplate('modalContentStart', []);
        $res = $this->formatTemplate('modalStart', [
            'dialogStart' => $dialogStart,
            'contentStart' => $contentStart,
            'attrs' => $this->templater()->formatAttributes($options, ['body', 'close', 'size']),
            'templateVars' => $options['templateVars']
        ]);
        if(is_string($title) && $title) {
            $res .= $this->_createHeader($title, ['close' => $options['close']]);
            if($options['body']) {
                $res .= $this->_createBody();
            }
        }
        return $res;
    }