Download the PHP package redant/twig-components-bundle without Composer

On this page you can find all versions of the php package redant/twig-components-bundle. 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-components-bundle

Twig Components

A Symfony bundle for the Twig Components library.

This bundle allows you to create robust, reusable and automatically documented Twig components using the new component tag. Twig components allow you to quickly build and maintain your own UI toolkit, where each button, table or card has to be designed only once and can be used throughout your entire application.

This Twig Components bundle for Symfony makes life a little bit easier by automatically searching your template directories for defined components, every time the Symfony container is compiled.

For more information about Twig Components, see the documentation.

Setup and Usage

You can install this bundle through Composer:

When this bundle is enabled in your Symfony bundle configuration, if will search all your template directories for defined components, every time the container is compiled.

This includes:

Global variable

If you don't like the name of the global variable that defines the components, use the twig_components.global_variable parameter to change this:

This will register the button component as ui.button().

Note: If you set the prefix to false, no Twig global will be registered for defined components. You can then only use the render_component function.

Namespaces

If you define your components in subdirectories of the components/ directory, the additional directories will namespace your component.

For example, a component defined in components/ui/button.html.twig will be accessible as component.ui.button({}) or via render_component('ui.button', {}).

Generate documentation

The added bonus to creating component definitions is the automatic creation of documentation. It explains, for instance, what your component can be used for and which parameters it accepts. For example, the Twig Components bundle can automatically generate a table like this for an example button component:

Property Type Default value Comment
container string button HTML container element
classes string[] [ 'small' ] Additional button classes
label* string Button text (rendered as raw HTML)
url string Hyperlink
confirm bool false

You can generate a static HTML file with documentation using the supplied twig:components:generate-docs command.



**Pro tip**: When you start your component template file with a comment (`{# ... #}`),
its contents will be added at the top of the documentation for the component.

## License

This library is licensed under the MIT License - see the LICENSE file for details.

All versions of twig-components-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
redant/twig-components Version ^1.0
symfony/console Version ^5.4|^6.4|^7.0
symfony/dependency-injection Version ^5.4|^6.4|^7.0
symfony/finder Version ^5.4|^6.4|^7.0
symfony/twig-bundle Version ^5.4|^6.4|^7.0
twig/twig Version ~1.41|~2.10|^3.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 redant/twig-components-bundle contains the following files

Loading the files please wait ....