Download the PHP package wwwision/renderlets-provider without Composer

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

Wwwision.Renderlets.Provider

Neos package to provide snippets of data/rendered content (aka 'renderlets') to be consumed by 3rd parties

Installation

Install via composer:

composer require wwwision/renderlets-provider

Usage

Renderlets can be defined underneath the Fusion path /renderlets:

With this in place, the renderlet is exposed via HTTP on the endpoint /__renderlet/some_renderlet

Parameters

Renderlets can define parameters that can be specified by the consumer via query arguments:

In this example, the "foo" parameter is required (true) while "bar" is optional. If the renderlet endpoint is requested without any query parameters (/__renderlet/renderlet_with_parameters) a 400 HTTP response is returned with the body:

If the parameters are specified (e.g. /__renderlet/renderlet_with_parameters?foo=foo%20value&bar=bar%20value) they are evaluated as expected:

[!NOTE]
Query parameters that don't match a configured parameter (e.g. /__renderlet/renderlet_with_parameters?fo=typo) also lead to a 400 status code to prevent misbehavior due to typos

Caching

Each renderlet is assigned a cacheId that will be turned into an ETag HTTP header in the response. This allows consumers to send a corresponding If-None-Match header in order to prevent unchanged renderlets from beeing transmitted again.

The cacheId is a random string by default that gets assigned at rendering time. In order to keep that consistent, a corresponding @cache meta property is defined in the renderlet declaration (see https://docs.neos.io/guide/manual/rendering/caching). If the renderlet content depends on other components or data, this property should be extended accordingly:

Example

Alternatively, the cacheId can be set to a static (or dynamic) value to make it deterministic:

For Renderlet Props the cache behavior can be configured via renderer.@cache

[!NOTE]
Parameters are always part of the cache entryIdentifier, so that every parameter combination is cached individually

HTTP Headers

Content-Type

By default, renderlets are rendered with a Content-Type header of "text/html". This can be changed via the httpHeaders prop:

CORS

By default, renderlets are rendered with a Access-Control-Allow-Origin header of "*" to allow them to be consumed without CORS restrictions. This can be changed via the httpHeaders prop:

Other headers

Other HTTP headers can be added via the httpHeaders prop:

Localization

Renderlet enddpoints work independantly from the Neos routing. As a result, nodes from the content repository will be loaded in their default dimension. But parameters are a good option to allow the consumer to change the language:

In this case, a lang query argument has to be specified that is used to load a node in the respective context.

Alternatively, the parameter could be made optional:

Renderlet Props

The RenderletProps prototype can be used to render data structures rather than (HTML) content:

This will render the following JSON on the endpoint /__renderlet/some_renderlet_props:

The Content-Type header of RenderletProps is application/json by default, but it can be changed as described above.

Cache segments

When rendering Fusion prototypes with their own @cache configuration within renderlets, this can lead to Content Cache markers to appear in the response (see issue for details). Therefore, starting with version 1.3.0 those markers are now stripped from the renderlet.

Note, that in order for the automatic cache flushing to work as expected, the @cache configuration has to be complete:

Contribution

Contributions in the form of issues or pull requests are highly appreciated

License

See LICENSE


All versions of renderlets-provider with dependencies

PHP Build Version
Package Version
Requires neos/neos Version ^7.3 || ^8.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 wwwision/renderlets-provider contains the following files

Loading the files please wait ....