2017 © Pedro Peláez
 

library modals

The implementation of Bootstrap modals for Nette framework.

image

brosland/modals

The implementation of Bootstrap modals for Nette framework.

  • Wednesday, April 25, 2018
  • by brosland
  • Repository
  • 2 Watchers
  • 0 Stars
  • 121 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Brosland / Modals

This package provides a simple management of modals for Nette framework (e.g. Bootstrap modals)., (*1)

List of components: - Modal - abstract class for a modal - ConfirmationModal - simple modal for a confirmation, (*2)

Installation

The best way to install is using Composer:, (*3)

$ composer require brosland/modals

1. (optional) Register DI extension ModalsExtension in your neon config. This step you can skip if you use Bootstrap 4., (*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, (*5)

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, (*6)

{snippet modal}{ifset $modal}{control $modal}{/ifset}{/snippet}

4. Install Webpack and Naja., (*7)

5. Copy src/Brosland/Modals/UI/Modal.js to your directory with Javascript files and register it in Naja., (*8)

6. Don't forget to rebuild Webpack bundles., (*9)

The Versions

25/04 2018

dev-master

9999999-dev http://bros.land

The implementation of Bootstrap modals for Nette framework.

  Sources   Download

MIT

The Requires

 

by Martin Bros

bootstrap nette brosland modals