brosland/modals
最新稳定版本:v2.2.0
Composer 安装命令:
composer require brosland/modals
包简介
The implementation of Bootstrap modals for Nette framework.
README 文档
README
This package provides a simple management of modals for Nette framework (e.g. Bootstrap modals).
List of components:
- Modal - abstract class for a modal
- ConfirmationModal - simple modal for a confirmation
Installation
The best way to install is using Composer:
$ composer require brosland/modals
1. (optional) Register DI extension ModalsExtension in your neon config.
This step you can skip if you use Bootstrap 4.
brosland.modals: version: 'v5' extensions: brosland.modals: Brosland\Modals\DI\ModalsExtension
2. Setup ModalManager: the best practice is to do it in your base presenter.
- add
ModalManagerTrait - implement interface
ModalManager - add update of modal into the method
beforeRender
use Brosland\Modals\UI\ModalManager; use Brosland\Modals\UI\ModalManagerTrait; use Nette\Application\UI\Presenter; abstract class BasePresenter extends Presenter implements ModalManager { use ModalManagerTrait; protected function beforeRender(): void { parent::beforeRender(); $this->updateModal(); } // ...
3. Add placeholder for a modal to your base layout
{snippet modal}{ifset $modal}{control $modal}{/ifset}{/snippet}
5. Copy src/Brosland/Modals/UI/Modal.js to your directory with Javascript files and register it in Naja.
6. Don't forget to rebuild Webpack bundles.
统计信息
- 总下载量: 431
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-13