PHPackages                             dragonee/php-silverplate - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dragonee/php-silverplate

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

dragonee/php-silverplate
========================

A minimal stack for creating static HTML/Markdown websites.

v0.8.1-p1(13y ago)1447[6 issues](https://github.com/dragonee/php-silverplate/issues)MITPHP

Since Dec 30Pushed 13y ago2 watchersCompare

[ Source](https://github.com/dragonee/php-silverplate)[ Packagist](https://packagist.org/packages/dragonee/php-silverplate)[ Docs](https://github.com/dragonee/php-silverplate)[ RSS](/packages/dragonee-php-silverplate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

php-silverplate
===============

[](#php-silverplate)

Forget to include header.php and footer.php anymore.

PHP Silverplate serves your static content on a silver platter. It does not matter if you need to write simple, one-page website, or a whole book - PHP Silverplate accepts any **HTML** or **Markdown** file and displays it inside a predetermined layout file. Pretty URLs and HTML5 Boilerplate included.

Quickstart Guide
----------------

[](#quickstart-guide)

Use Composer to download the stable version:

```
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar create-project dragonee/php-silverplate

```

Make your changes in the `index.php` file. Add necessary style declarations to the `css/main.css`. Then access the main directory of PHP Silverplate installation with your web browser.

Features
--------

[](#features)

- single `layout.php` file for the whole website (with an ability to specify layout file on a per-file basis).
- file formats: `.php` for HTML/PHP files, `.md` for Markdown, `.redir` for redirects to other URLs.
- Markdown files are parsed by excellent PHP Markdown library:
- pretty URL rewriting with `.htaccess`
- simple structure - place `text.php` in the website directory and access it via the `example.com/text/` address.
- nested directories are also supported.
- single `404.php` file for your convenience.
- HTML5 Boilerplate v4.0.2 - you can go straight to the business.

Usage
-----

[](#usage)

When an user navigates to the arbitrary URI, for example `/example`, `app.php` begins to search for corresponding file in the following order:

- At first, it checks for an directory named `example`. If such directory exists, `app.php` sets its URI internally to `/example/index` and resets the search.
- Next, a file with the name `example.md` is looked up. If it exists, it is parsed as Markdown file and rendered in the `layout.php` file.
- Next, a file with the name `example.php` is looked up. If it exists, it is treated as the PHP file and rendered in the `layout.php` file.
- Next, a file with the name `example.redir` is looked up. If it exists, the script returns 302 Found response and redirects to the link specified in the contents of the .redir file.
- If no file is found, `404.php` is displayed and the application responds with 404 Page Not Found response. `404.php` is rendered independently from the layout file.

`app.php` is completely transparent and relies on the filesystem to find files. That means you are able to structure your files in subdirectories any way you want.

`app.php` does not allow accessing files that are outside the directory `app.php` is located in. This also affects symbolic links.

### Blocks

[](#blocks)

You can provide blocks in the layout file that can be overwritten by data specified in the content file. The most common use case is to provide the `` tag of the document.

In order to define a block, put a `get()` function in the layout file:

```

```

You can override the default value of the title block by setting it in the content file:

```

```

Or in the Markdown file:

```
Meta title: Another page

```

In PHP content files you can also `open()` and `close()` multiline blocks:

```

    [...]

```

Currently Markdown files do not have any support for the opening and closing blocks.

### Custom Layouts

[](#custom-layouts)

In order to specify custom layout file for a content file, fill a layout block:

```

```

or:

```
Meta layout: my_layout

```

Make sure, that the `my_layout.php` file is present before using it.

### Relative URLs

[](#relative-urls)

With the release of v0.8.1, PHP Silverplate gives you a way to write paths in your layout and content files in a relative maneer to the application root directory.

- Use `path://some-image.png` in your Markdown files.
- Use `App::path('some-image.png')` in your PHP files.

### Design

[](#design)

You can style your files differently based on their type. `app.php`provides your `layout.php` file with two different classes:

- `.php-file` for PHP files.
- `.md-file` for Markdown files.

These classes can help you distinguish between styles specific for your Markdown document layouts and between your PHP layouts.

The `layout.php` provided in this distribution also defines the `classes`block, which can be used to build some conditional CSS styles for some files on your website.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~1 days

Total

4

Last Release

4884d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/760f239b0a5790f993168056b5f5f4b2d7faa0384e8f874323c89ddd5d7b93e2?d=identicon)[dragonee](/maintainers/dragonee)

---

Top Contributors

[![dragonee](https://avatars.githubusercontent.com/u/937024?v=4)](https://github.com/dragonee "dragonee (41 commits)")

---

Tags

htmlmarkdownstaticwebsitesilverplate

### Embed Badge

![Health badge](/badges/dragonee-php-silverplate/health.svg)

```
[![Health](https://phpackages.com/badges/dragonee-php-silverplate/health.svg)](https://phpackages.com/packages/dragonee-php-silverplate)
```

###  Alternatives

[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k28.6M199](/packages/league-html-to-markdown)[pixel418/markdownify

The HTML to Markdown converter for PHP

196800.8k8](/packages/pixel418-markdownify)[texy/texy

Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated against spambots), national typographic single and double quotation marks, ellipses, em dashes, dimension sign, nonbreakable spaces (e.g. in phone numbers), acronyms, arrows and many others. Texy code can optionally contain HTML tags.

161838.9k15](/packages/texy-texy)[interaction-design-foundation/nova-html-card

A Laravel Nova card to display arbitrary HTML content

67731.2k3](/packages/interaction-design-foundation-nova-html-card)[3f/converter

A set of classes to translate a text from HTML to BBcode and from BBCode to Markdown.

29148.7k](/packages/3f-converter)[jbroadway/slimdown

A simple regex-based Markdown parser.

357.7k](/packages/jbroadway-slimdown)

PHPackages © 2026

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