jansuchanek / nattachments
Universal file attachments component for Nette — upload, delete, reorder, rename, lightbox, PDF preview
Package info
github.com/JanSuchanek/nattachments
Language:Latte
pkg:composer/jansuchanek/nattachments
v1.1.0
2026-03-20 14:34 UTC
Requires
- php: >=8.2
- latte/latte: ^3.0
- nette/application: ^3.2
- nette/http: ^3.2
README
File attachment system for Nette Framework — upload, manage, and associate files with Doctrine entities.
Features
- 📎 File Uploads — Drag & drop with preview
- 🖼️ Image Thumbnails — Auto-generated previews
- 🔗 Entity Association — Link files to any Doctrine entity
- 🗑️ CRUD — Rename, reorder, delete with AJAX
- ⚙️ DI Extension — Auto-registers upload services
Installation
composer require jansuchanek/nattachments
Configuration
extensions: attachments: NAttachments\DI\NAttachmentsExtension attachments: uploadDir: %wwwDir%/uploads
Usage
In your presenter:
#[Inject] public AttachmentControlFactory $attachmentFactory; protected function createComponentAttachments(): AttachmentControl { return $this->attachmentFactory->create($this->entity); }
In your Latte template:
{control attachments}
Requirements
- PHP >= 8.2
- Nette Application ^3.2
- Doctrine ORM ^3.0
License
MIT