Download the PHP package settermjd/zend-expressive-static-pages without Composer

On this page you can find all versions of the php package settermjd/zend-expressive-static-pages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zend-expressive-static-pages

Laminas Static Pages Module

testing workflow

An, almost, painless way to render static pages in Mezzio applications.

Note: This module does not support laminas-mvc applications.

The intent of this package is to avoid the necessity to create handlers and handler factories just to render static content. It was motivated by various projects that I've worked on, where that seemed to be the case, at least at the time. That approach never made sense to me, so that's that motivated me to scratch my own itch.

Getting Started

To install the package, run composer require settermjd/laminas-static-pages.

If you want to automate the enabling of the module when running composer require/install/update, then your project needs to use laminas/laminas-component-installer. If it does, when the package is installed you'll be asked if you want to enable its ConfigProvider. Answer with Y and the package will be ready to use.

If you don't use laminas-component-installer, or for some reason or other can't, then ensure that \StaticPages\ConfigProvider::class, is in the ConfigAggregator list in config/config.php, as in the example below.

With the package installed, you now need to do two further steps:

  1. Configure the template path
  2. Create routes
  3. Create template files

Configure The Template Path

To configure the template path, ensure that in your template paths list, there's one with the key static-pages, as in the example below.

Create Routes

To create a route for a static page, in your routing table, add one or more named routes where:

  1. The route’s handler is StaticPagesHandler::class
  2. The name follows the convention: static.<template_file_name_minus_file_extension>.

Let's assume that we are adding a route for a privacy page and that the template file which will be rendered is privacy.phtml. In that case we'd add the following to config/routes.php:

Create Template Files

The file can contain whatever you like, it doesn't matter.

That’s It

All being well, this should be all that you need to rapidly serve static content files in your Mezzio applications.

Support


All versions of zend-expressive-static-pages with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0
laminas/laminas-config-aggregator Version ^1.6.0
laminas/laminas-diactoros Version ^2.8.0
mezzio/mezzio Version ^3.6.0
laminas/laminas-stdlib Version ^3.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package settermjd/zend-expressive-static-pages contains the following files

Loading the files please wait ....