Download the PHP package forme/platine without Composer

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

Platine

A pure PHP templating library with layouts, components and slots.

Platine is the default templating library for Forme, a WordPress MVC framework, but can be used in any PHP project.

Background

Platine is a hard fork of Plates v4 alpha by RJ Garcia (@ragboyjr). V4 alpha introduced some substantial improvements over v3 — a functional extension system, a composable render pipeline, a render context object ($v), and a component/slot system.

Unfortunately the v4 branch was reverted and the changes were never released. The Plates repository returned to v3 and v4 development was abandoned. Some features are being ported back but the file-based component and slot system was shelved in favour of an inline function approach.

Platine preserves and continues that v4 work. The core architecture is intact and the library is maintained as a standalone package independent of the PHP League.

If you were using or interested in Plates v4, this is its continuation.

Requirements

Installation

Getting Started

Create a view instance with a base directory for your templates:

Render a template, passing in an array of data:

Templates

Template files are plain PHP files. The render context object is available as $v within every template.

Use $v->e() to escape output:

Layouts

Declare a layout at the top of your template:

In the layout, use $v->section('content') to render the child content:

Pass variables up to the layout:

Layouts can be nested:

Insert

Include another template using insert():

Pass data to the partial:

Components

Components are isolated templates rendered with an explicit data scope. Use component() with end() to capture slot content:

Named Slots

Use slot() inside a component call to capture named regions:

Template References

Leave off the file extension when referencing templates. Both slash and dot notation work:

Templates named index can be referenced with a trailing slash or dot:

Custom Functions

Register custom functions on the engine using registerFunction():

Then use them in templates via $v:

Render Context Variable Name

The render context is injected into templates as $v by default. This is configurable:

Validation

Platine ships with a Validator that enforces template coding standards. See Validator::validate().

This runs by default on render, but you can switch it off by setting the global FORME_PLATINE_VALIDATION constant to false.

Git Hook

If you use CaptainHook, you can lint templates automatically on commit. First require CaptainHook:

Then add to your captainhook.json:

Todo

Acknowledgements

Original Plates v4 alpha work by RJ Garcia. See https://github.com/thephpleague/plates. Both are MIT licensed — copyright notices preserved in LICENSE.

License

MIT. See LICENSE.


All versions of platine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 forme/platine contains the following files

Loading the files please wait ...