Download the PHP package ocubom/twig-svg-extension without Composer

On this page you can find all versions of the php package ocubom/twig-svg-extension. 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-svg-extension

Ocubom Twig SVG Extension ========================= A custom suite of Twig filters for SVG manipulation [![Contributors][contributors-img]][contributors-url] [![Forks][forks-img]][forks-url] [![Stargazers][stars-img]][stars-url] [![Issues][issues-img]][issues-url] [![License][license-img]][license-url] [![Version][packagist-img]][packagist-url] [![CI][workflow-ci-img]][workflow-ci-url] [![Code Quality][quality-img]][quality-url] [![Coverage][coverage-img]][coverage-url] [**Explore the docs »**][Documentation] [Report Bug](https://github.com/ocubom/twig-svg-extension/issues) · [Request Feature](https://github.com/ocubom/twig-svg-extension/issues)
Contents * [About TwigSvgExtension](#about-twigsvgextension) * [Getting Started](#getting-started) * [Installation](#installation) * [Usage](#usage) * [Roadmap](#roadmap) * [Contributing](#contributing) * [Authorship](#authorship) * [License](#license)

About TwigSvgExtension

TwigSvgExtension is a custom suite of Twig filters for SVG manipulation.

This suite started as an internal class to inline SVG files into HTML documents. This class used to be embedded into several projects. Over time, each project adapted its version slightly, leading to fragmented development and difficult maintenance. Therefore, the development is unified in this extension which is made public in case it is useful for other projects.

Getting Started

Installation

Just use composer to add the dependency:

Or add the dependency manually:

  1. Update composer.json file with the lines:

  2. And update the dependencies:

Usage

Just register the Twig extension:

The extension defines several filters and functions.

SVG Extension Core

svg function

The svg function embeds an SVG defined in an external file into the template.

The path is relative to the search path provided as the first argument when creating the runtime.

The second argument can be used to add some attributes to the root element:

svg (or svg_symbols) filter

This filter looks for embedded SVGs and converts each of them into a reference to a symbol.

Warning

The filter must be applied at an HTML document level.

If the filter is used in a fragment, an exception will be generated.

Note

The svg function can be used to embed SVG files that will be converted with this filter.

FontAwesome Provider

fa function

Generates a simple FontAwesome HTML tag:

Will generate:

Warning

The result may be slightly different. The order of the attributes or their values may vary.

fontawesome filter

This filter looks for FontAwesome tags and replaces them by embedding the corresponding SVG.

Warning

The filter must be applied at HTML document level.

If the filter is used in a fragment, an exception will be generated.

Note

The fa function can be used to generate the tags.

Iconify Provider

iconify filter

This filter looks for Iconify SVG Framework or Web Component and replaces them by embedding the corresponding SVG.

Warning

The filter must be applied at HTML document level.

If the filter is used in a fragment, an exception will be generated.

Roadmap

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

  1. Fork the Project.
  2. Create your Feature Branch (git checkout -b feature/your-feature).
  3. Commit your Changes (git commit -m 'Add your-feature').
  4. Push to the Branch (git push origin feature/your-feature).
  5. Open a Pull Request.

Authorship

See also the list of contributors who participated in this project.

License

Distributed under the MIT License. See LICENSE for more information.


All versions of twig-svg-extension with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-dom Version *
ext-libxml Version *
bentools/iterable-functions Version ^2.0
iconify/json-tools Version ^1.0
masterminds/html5 Version ^2.0
ocubom/base-convert Version ^2.0
symfony/deprecation-contracts Version ^2.5|^3.2
symfony/options-resolver Version ^5.4|^6.0|^7.0
twig/twig Version ^2.7|^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 ocubom/twig-svg-extension contains the following files

Loading the files please wait ....