PHPackages                             tyhand/document-downloader-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. tyhand/document-downloader-bundle

ActiveSymfony-bundle[File &amp; Storage](/categories/file-storage)

tyhand/document-downloader-bundle
=================================

A quick lazy and somewhat useless bundle to handle download links to static pdf files

v0.1.0(11y ago)03.1k2MITPHP

Since Dec 1Pushed 11y ago2 watchersCompare

[ Source](https://github.com/tyhand/DocumentDownloaderBundle)[ Packagist](https://packagist.org/packages/tyhand/document-downloader-bundle)[ RSS](/packages/tyhand-document-downloader-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Document Downloader Bundle
==========================

[](#document-downloader-bundle)

A quick, lazy, and somewhat useless bundle to provide a quicker way to produce links to a static pdf document while providing some minor security.

Installing
----------

[](#installing)

First add the project to your Symfony project's composer.json, which can be done via the command line like the following.

```
$ composer require tyhand/document-downloader-bundle "~0.1"
```

Next, add the bundle to your project's AppKernel.php in the register bundles method.

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ... The other bundles
        new TyHand\DocumentDownloaderBundle\TyHandDocumentDownloaderBundle()
    )
}
```

Next, since this bundle has a controller action, you need to include the bundle's routing file into the project's main routing file.

```
# app/config/routing.yml
TyHandDocumentDownloader:
    resource: "@TyHandDocumentDownloaderBundle/Resources/config/routing.yml"
    prefix: /documents
    # prefix can be whatever you need it to be
```

Finally, the bundle needs a path to the file containing the list of documents. By default the bundle will look for it at app/config/file\_list.yml. If you desire the document list file to be there then installation of the bundle is complete; However, if you need the file list to be elsewhere you add a config option to change the location such as the following.

```
# app/config/config.yml
tyhand_document_downloader:
    file_list: /path/relative/to/the/app/folder.yml
```

Usage
-----

[](#usage)

### Basic

[](#basic)

To create a link to a static document, first add the document to the file list yaml.

```
# file_list.yml
my_pdf:
    path: ../Resources/MyPDF.pdf
```

Then in the twig file where you want to have a link to the document use the twig function provided in the bundle to create something along the lines of the following.

```
My PDF
```

### Restricting By Roles

[](#restricting-by-roles)

There are two ways to restrict by roles, 'allow' and 'deny'. Allow sets a list of roles that a user needs at least one of to retrieve the document; Whereas Deny sets a list of roles that if the user has any of them then they cannot retrieve the document.

For example, if given the following example config:

```
# file_list.yml
my_pdf:
    path: ../Resources/MyPDF.pdf
    allow:
        - ROLE_USER

supervisor_notice:
    path: ../Resources/SupervisorNotice.pdf
    allow:
        - ROLE_SUPERVISOR
```

A user with the roles \['ROLE\_USER', 'ROLE\_SUPERVISOR'\] can view both documents, but a user with the roles \['ROLE\_USER'\] can only view the my\_pdf document. If the link to supervisor\_notice was somehow visible to the user without the supervisor role, a 403 will be returned if they try to retrieve it.

Another example this time for deny:

```
# file_list.yml
coup_detat_plans:
    path: ../Resources/donotlookatthis.pdf
    deny:
        - ROLE_SUPERVISOR
```

In this case any user with 'ROLE\_SUPERVISOR' cannot view the document.

Currently the 'allow' option and the 'deny' option cannot be used at the same time for a single file.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4179d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9133c4cc70f51fc7adab9eb771250751a22cde403b41fe0adb9589400170e3f0?d=identicon)[tyhand](/maintainers/tyhand)

---

Top Contributors

[![tyhand](https://avatars.githubusercontent.com/u/4419522?v=4)](https://github.com/tyhand "tyhand (18 commits)")[![patkinso](https://avatars.githubusercontent.com/u/7914740?v=4)](https://github.com/patkinso "patkinso (1 commits)")

### Embed Badge

![Health badge](/badges/tyhand-document-downloader-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tyhand-document-downloader-bundle/health.svg)](https://phpackages.com/packages/tyhand-document-downloader-bundle)
```

###  Alternatives

[jbouzekri/file-uploader-bundle

Aggregate some bundles and libraries to provide easy ajax file upload integration with functionnalities like image croping or storage on amazon

258.1k2](/packages/jbouzekri-file-uploader-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
