loveorigami / yii2-modal-ajax

A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside.
MIT License
50 stars 30 forks source link

bootstrap4 #23

Open ivankff opened 5 years ago

ivankff commented 5 years ago

Hello. This extension depends on yiisoft/yii2-bootstrap but I use yiisoft/yii2-bootstrap4 in my projects.

How can I use your extension with bootstrap4 ?

loveorigami commented 5 years ago

I think, you can re-write https://github.com/loveorigami/yii2-modal-ajax/blob/master/src/ModalAjaxAsset.php#L19 for capability with bootstrap4.

Try. If it will be ok - I create new major version for bootstrap 4.

ivankff commented 5 years ago

I created the fork https://github.com/ivankff/yii2-modal-ajax

And made some changes to make it compatible with Twitter Bootstrap 4: 1) replaced dependency from yii\bootstrap\BootstrapAsset to yii\bootstrap4\BootstrapAsset 2) removed function renderHeader (in bootstrap 4 modal's header includes tag h5, so span is unnecessary now) 3) added require rection in composer.json 4) changed package version composer.json to 4.0 5) updated readme

Note: there is no header attribute in yii\bootstrap4\Modal. You have to use title instead of header in order to set Modal's header/title.

ivankff commented 5 years ago

I suggest you creating new major version or brach by merging my fork into your repository. Then I'll remove my fork and use this rep. What do you think ?

loveorigami commented 5 years ago

I think create new option in widget - $bootstrapVersion, and delete dependency from composer. As in my widget https://github.com/loveorigami/yii2-notification-wrapper#full-installation for notyAssets.

ivankff commented 5 years ago

It's great idea. I removed dependencies from asset and composer and added an option $bootstrapVersion All changes are in my fork https://github.com/ivankff/yii2-modal-ajax

loveorigami commented 5 years ago

Thanks for support. It is similar, as I think. I shall be have free time in week-end and rewrite code for both bootstrap version.

With https://github.com/yiisoft/yii2-bootstrap4/blob/master/src/Modal.php and https://github.com/yiisoft/yii2-bootstrap/blob/master/src/Modal.php

niyozbek commented 4 years ago

i fixed it and sent a pull request!

loveorigami commented 4 years ago

Thanks, but is not BS4 support. It is only BS4 release without BS3 support.

user1007017 commented 2 years ago

as long as I had "yiisoft/yii2-bootstrap4": "~2.0.0", in composer.json it didn't show the modal, although it was there, but still with css class fade and invisible