PHPackages                             simotod/slim-download - 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. [Templating &amp; Views](/categories/templating)
4. /
5. simotod/slim-download

ActiveLibrary[Templating &amp; Views](/categories/templating)

simotod/slim-download
=====================

Slim extension to implement download view render

v1.1.0(11y ago)11232MITPHPPHP &gt;=5.3.0

Since Feb 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/SimoTod/slim-download)[ Packagist](https://packagist.org/packages/simotod/slim-download)[ Docs](https://github.com/SimoTod/slim-download)[ RSS](/packages/simotod-slim-download/feed)WikiDiscussions master Synced 1mo ago

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

slim-download
=============

[](#slim-download)

This is an extension to the [SLIM framework](https://github.com/codeguy/Slim) vers.2 to implement the download of a file from a route. It can be used to check the user permissions before of permits the downloading of a file, to count the number of download or for something else useful.

\##Installation Using composer you can add use this as your composer.json

```
    {
        "require": {
            "simotod/slim-download": "dev-master"
        }
    }
```

\##Usage

```
    require 'vendor/autoload.php';

    $app = new \Slim\Slim();

	$app->get('/download', function () use ($app) {
		//Do some stuff here

		$filepath = "/path/to/file";

		$app->view(new \SimoTod\SlimDownload\DownloadView());
		$app->render($filepath);
	});

	$app->run();

```

\###example method all your requests will be returning a file output. the usage will be `$app->render( (string)$FILE_PATH, (array)$DATA);`Downladed file use the real name and 'application/octet-stream' as content type. Content type can be overriden by $DATA\["CONTENT\_TYPE"\]. File name can be overriden by $DATA\["FILENAME"\].

```
	$app->get('/download', function () use ($app) {
		//Do some stuff here

		$filepath = "/path/to/pdf";
		$data = array();
		$data["CONTENT_TYPE"] = "application/pdf";
		$data["FILENAME"] = "sample.pdf";

		$app->view(new \SimoTod\SlimDownload\DownloadView());
		$app->render($filepath);
	});

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~46 days

Total

2

Last Release

4066d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/499c3ec1a8f4178f10844d45031b401be825313793d5e588636ac2d13481c1f8?d=identicon)[SimoTod](/maintainers/SimoTod)

---

Top Contributors

[![SimoTod](https://avatars.githubusercontent.com/u/8427737?v=4)](https://github.com/SimoTod "SimoTod (1 commits)")

---

Tags

slimviewdownload

### Embed Badge

![Health badge](/badges/simotod-slim-download/health.svg)

```
[![Health](https://phpackages.com/badges/simotod-slim-download/health.svg)](https://phpackages.com/packages/simotod-slim-download)
```

###  Alternatives

[entomb/slim-json-api

Slim extension to implement fast JSON API's

268156.4k4](/packages/entomb-slim-json-api)[petebrowne/slim-layout-view

A Custom View supporting Layouts for the Slim Framework.

3518.0k](/packages/petebrowne-slim-layout-view)[dogancelik/slim-json

JSON middleware for Slim PHP framework

3984.0k3](/packages/dogancelik-slim-json)

PHPackages © 2026

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