fri-uniza/modals

The implementation of Bootstrap modals for Nette framework.

1.0 2018-02-08 13:16 UTC

This package is not auto-updated.

Last update: 2025-06-16 22:10:45 UTC


README

List of components:

  • Modal - abstract class for modal
  • ConfirmModal - simple modal for confirmation

Installation

The best way to install is using Composer:

$ composer require brosland/modals

1 add ModalTrait to your base presenter and override method beforeRender

abstract class BasePresenter extends \Nette\Application\UI\Presenter
{
	use \Brosland\Modals\ModalTrait;

	protected function beforeRender()
	{
		parent::beforeRender();

		$this->updateModal($this);
	}
	// ...

2 add placeholder for a modal to your base layout

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

3 Copy brosland.modals.js to your directory with Javascript files (you can use Bower for this).

4 Link the file in your templates (usually in app/@layout.latte, after jQuery!).