Download the PHP package guym4c/twig-prop-types without Composer

On this page you can find all versions of the php package guym4c/twig-prop-types. 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 twig-prop-types

twig-prop-types

React prop types, ported to Twig.

Installation

With Composer:

Usage

This package makes guym4c/prop-types accessible in Twig. For documentation on how to use the prop types themselves, refer to that package.

Props in the Twig sense refers to the current context. You can use the only keyword in Twig to stop the context scope being inherited.

The extension constructor requires the current Twig environment and a flag to bypass the prop checker. You will probably want to prevent the validator from running in production, to avoid any performance issues. (This will not prevent default prop values being set.)

Validation

To validate your props, put the following at the top of a template file:

Twig-specific differences

When giving a fully-qualified classname when checking for an instance type, you may use dots instead of backslashes to simplify string escaping issues, and the leading backslash or dot is optional.

Advanced

You may pass additional properties to the constructor:

Default values

If required, you must set default values of required props after the props() call to ensure that required props fail correctly if not provided.

The props() and defaults() calls are separated by the Twig concatenate operator (~) so that they may be called in the same {{ output block }} without throwing an error. Both of these functions never return a value, so it is safe to do so.


All versions of twig-prop-types with dependencies

PHP Build Version
Package Version
Requires twig/twig Version ^3.0
guym4c/prop-types Version ^1.0.1
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 guym4c/twig-prop-types contains the following files

Loading the files please wait ....