Download the PHP package mehrkanal/twig-encore-extension without Composer
On this page you can find all versions of the php package mehrkanal/twig-encore-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mehrkanal/twig-encore-extension
More information about mehrkanal/twig-encore-extension
Files in mehrkanal/twig-encore-extension
Download mehrkanal/twig-encore-extension
More information about mehrkanal/twig-encore-extension
Files in mehrkanal/twig-encore-extension
Vendor mehrkanal
Package twig-encore-extension
Short Description Twig Extension to use entrypoints.json in Twig Templates
License GPL-3.0-or-later
Package twig-encore-extension
Short Description Twig Extension to use entrypoints.json in Twig Templates
License GPL-3.0-or-later
Please rate this library. Is it a good library?
Informations about the package twig-encore-extension
Twig and Webpack Encore Extension for Laminas
To use with twig/twig
and symfony/webpack-encore-bundle
Created for: Laminas/Mezzio
Applications without native Symfony Kernel.
Warning: If Symfony is available, just use the symfony/webpack-encore-bundle
bundle as is.
How to use and configure Encore
composer require symfony/webpack-encore-bundle
- npm i @symfony/webpack-encore
- webpack.config.js
setOutputPath()
should be in the public folder- i.e.
.setOutputPath('public/assets')
- i.e.
setPublicPath()
should be in the folder where the assets are in- i.e.
setPublicPath('/assets')
- i.e.
- Set
['twig']['asset_url']
to the absulute Path, for example in your twig.global.php- Best be set to:
/app/public/assets/
- Note: A Forward Slash is appended after asset_url in case the preceding path does not end on a forward slash
- i.e. asset_path is
/assets
the url will be<document_root>/assets/entrypoints.json
- i.e. asset_path is
- Best be set to:
- Include
Mehrkanal\EncoreTwigExtension\ConfigProvider::class
into your global config - Include
Mehrkanal\EncoreTwigExtension\Extensions\GetCssSourceTwigExtension:class
to your['twig']['extensions']
config. - Include
\Symfony\Bridge\Twig\Extension\AssetExtension::class
to your['twig']['extensions']
config. - Include
Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension:class
to your['twig']['extensions']
config.
What can I do now?
- Use Encore NodeJS Scripts to automatically generate assets
- Use
encore_entry_link_tags(<entrypoint>)
function in Twig to get all required stylesheet link tags - Use
encore_entry_script_tags(<entrypoint>)
function in Twig to get all required script tags - Use
encore_get_css_source(<entrypoint>)
function in Twig to get all CSS Code from this entrypoint
Use in combination with setEntry of Encore Webpack Config.
Stan
Useful links:
- Original Code
- https://symfony.com/doc/current/frontend/encore/installation.html
- https://gitlab.mehrkanal.com/mehrkanal/skeleton.git
Team
All versions of twig-encore-extension with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
symfony/webpack-encore-bundle Version ^v2.0.0
symfony/twig-bridge Version *
twig/twig Version ^1.42.5 || ^2.12.5 || ^3.0.3
symfony/webpack-encore-bundle Version ^v2.0.0
symfony/twig-bridge Version *
twig/twig Version ^1.42.5 || ^2.12.5 || ^3.0.3
The package mehrkanal/twig-encore-extension contains the following files
Loading the files please wait ....