Download the PHP package phpdot/template without Composer

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

phpdot/template

Swoole-safe Twig integration for PHPdot. A single Twig\Environment is built once per worker and shared across coroutines; Twig extensions are auto-discovered from installed package manifests and resolved through the container. Application code touches only the small View API.

Table of Contents

Requirements

Requirement Constraint
PHP >= 8.5
phpdot/package ^0.7
psr/container ^2.0
twig/twig ^3.10

phpdot/config and phpdot/container are require-dev only (phpdot/container also appears in suggest) — the #[Config('template')] / binding attributes are inert until a phpdot application reflects them.

Installation

Usage

Three objects; your application code touches only View:

The View API

TemplateConfig carries namespaced paths, an optional compiled-template cache, and the debug, strictVariables, autoReload, and autoescape flags.

Output formatting

format re-indents rendered browser HTML through ext-tidy — on by default, off with 'format' => false. Only browser HTML is touched (.html.twig, .htm.twig, or a bare .twig); .mail.twig, .txt/.csv/.xml.twig templates are returned exactly as rendered, because tidy restructures the table layouts and Outlook conditional comments email depends on. Formatting is fail-open: markup tidy cannot parse comes back unchanged, never lost. With formatting enabled the constructor requires ext-tidy and fails at boot, naming both remedies.

Console

When a phpdot application discovers commands, the package contributes one:

It removes only what Twig writes — the two-character buckets of hash-named .php files — so a misconfigured cache path cannot cost application code, and it reports "already empty" when the directory does not exist yet or "disabled" when no cache path is set. A running Swoole worker keeps the compiled classes it has already loaded, so clear, then restart the server. Clear on every deploy that changes templates, autoescape, or charset: Twig's compiled-class key covers neither of those two options, so a warm cache keeps the previous setting silently.

phpdot/console and symfony/console are require-dev + suggest only: the command class stays inert until a console loads it, so standalone consumers pay nothing for it.

Architecture

View delegates to EngineFactory, which builds the shared Twig\Environment on first use — wiring the filesystem loader from the configured paths and registering every Twig extension advertised by an installed package's Manifest, each resolved as a singleton through the container. The environment is built once and reused, which keeps it safe to share across Swoole coroutines.

Testing

License

MIT.

This repository is a read-only mirror, generated by CI from phpdot/monorepo. Pull requests and issues belong in the monorepo.


All versions of template with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
phpdot/package Version ^0.7
psr/container Version ^2.0
twig/twig Version ^3.10
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 phpdot/template contains the following files

Loading the files please wait ...