Download the PHP package akawalko/latte-template-renderer without Composer

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

latte-template-renderer

Interface implementation for a class that renders templates for string and PSR-7 response objects using Latte engine - a Next-Generation Templating System for PHP.

Installation

You can download this library using Composer:

Require php: >=8.0

Setup

Example integration using the PHP-DI container.

Methods

__get(string $name);

Get template variable. Return mixed value.

__set(string $name, $value): void;

Set template variable.

__isset(string $name): bool;

Determine if a variable is declared and is different than null.

__unset(string $name): void;

Unset a given variable

getVar(string $name);

Get template variable. Return mixed value.

setVar(string $name, $value): self;

Set template variable.

getVars(): array;

Get template variables.

setVars($data = []): self;

Set template variables from associative arrays or object. When an object is given, this method will work in a way similar to the spread operator known from handling arrays. That is, each object property will be assigned to the template as a standalone, e.g. Let's consider this example,

In the template, however, the data will be available without using a prefix in the form of an object

For this to work, the given object must meet 1 of 3 conditions:

However, there is a caveat when your class implements the JsonSerializable interface. Namely, when the jsonSerialize() method returns a scalar instead of an array, its value will be assigned to a key called object_single_var. Subsequent assignments will overwrite this value. At this moment it is not possible to set a key name for the returned scalar. This may change in the future depending on how useful this feature will be.

If you are not sure what data the objects will return after executing the jsonSerialize method, it will be better to assign them using setVar(string $name, $value) method.

renderToString(string $templatePath, $data = []): string;

Render the template to string with given data.

renderToResponse(ResponseInterface $response, string $templatePath, $data = []): ResponseInterface;

Render the template to PSR compliant Response class with given data.

render(...$arguments);

A shortcut method that executes renderToString() or renderToResponse() based on the arguments passed. Return ResponseInterface or string.


All versions of latte-template-renderer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json Version *
ext-tokenizer Version *
latte/latte Version ^3.0
akawalko/template-renderer-interface Version ^1.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 akawalko/latte-template-renderer contains the following files

Loading the files please wait ....