Download the PHP package rareloop/primer without Composer

On this page you can find all versions of the php package rareloop/primer. 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 primer

Primer

Latest Stable Version CI Coveralls Downloads

Primer is an extensible Design System/Pattern Library written in PHP. By default it utilises Twig for templating and Markdown/YAML for Documentation.

Installation

To create a new Primer project run the following command:

composer create-project rareloop/primer my-primer-folder --remove-vcs

Usage

The easiest way to get up and running is to use the inbuilt PHP Standalone Server:

composer server

And then open the following URL in your browser http://localhost:8080.

If you need to specify the port you can pass this as an argument to the command:

composer server 1234

Getting Started

Primer has three separate sections:

  1. Documents - A place to store the written documentation for your Design System.
  2. Patterns - A Pattern Library that catalogues all the components within your system.
  3. Templates - A way to view the various Page Templates available in your system.

Patterns

Patterns are the building blocks of your system and Primer provides a simple way to view your entire catalogue, a selection or just a single item. Patterns are located in the resources/patterns folder and are themselves a folder that contain all it's related files.

Anatomy of a pattern

Each Pattern has an implicit id and title.

The id is the path used to identify it under the patterns folder, e.g. elements/forms/input.

A patterns title is built from the name of the pattern's folder, e.g. elements/lists/ordered-list => Ordered List.

Each pattern folder can contain the following:

State Data

Out of the box, Primer supports State Data in two formats, PHP or JSON.

PHP State Data

PHP State Data files are named data.php and must return an array of key/values. This data is then passed to your Twig template at render time.

JSON State Data

State Data can also be provided as JSON files which are named data.json. This data is then passed to your Twig template at render time.

Alternative State Data

When building a Pattern Library it is important to be able to easily test the different states a component can be in and Primer makes this easy. Alternative states can be provided by adding additional files to your Pattern folder in the format:

data~statename.(php|json)

For example to show the error state for an input component you could create a file called data~error.php.

Including patterns within one another

Any pattern can be included within another by using the standard Twig include and referencing the Pattern with it's id, e.g.

Templates

Templates can be built up using a mix of custom HTML and Pattern includes and are stored in resources/templates. If required additional grouping/nesting can be achieved by adding folders.

All templates should extend from primer-base.twig and your custom content should be added to the templateContent block, e.g.

Documents

Primer provides a simple way to present your Design System Documentation using MarkDown files.

To add a new Documentation Page, simply add a Markdown file (with the .md extension) to resources/docs folder. You can create grouping/nesting by including folders in the structure.

Meta Data

By default Primer will give your Page a title based on the filename but this can be overwritten by adding YAML FrontMatter to your file. For example, to specify the Title and Description you could do the following:

Both title & description are keywords that Primer knows how to handle but you are free to add any additional meta data to the FrontMatter that you like. All Markdown files are also passed through the Twig Environment, so custom meta can be used to dynamically generate HTML.

Adding Frontend Assets

Primer is un-opinionated about what Frontend stack you choose to use. Once you're ready to add CSS and JavaScript assets to your HTML, you should do this in the views/primer-base.twig file. This is a common ancestor that all Primer requests use which will ensure your Patterns and Templates will render as you'd expect.


All versions of primer with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
symfony/finder Version ^4.2
twig/twig Version ^2.6
rareloop/primer-core Version ^3.0.0
rareloop/primer-frontend Version ^1.0.0
rareloop/router Version ^4.2
http-interop/response-sender Version ^1.0
zendframework/zend-diactoros Version ^1.4
php-di/php-di Version ^6.0
gajus/dindent Version ^2.0
symfony/debug Version ^4.2
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 rareloop/primer contains the following files

Loading the files please wait ....