endroid / embed
Endroid Embed
Fund package maintenance!
endroid
Installs: 37 600
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
- ext-fileinfo: *
- endroid/installer: ^1.3.1
- twig/twig: ^3.0
Requires (Dev)
- endroid/quality: dev-main
Suggests
- roave/security-advisories: Avoids installation of package versions with vulnerabilities
README
By endroid
Library for embedding external resources and reduce the number of requests.
Read the blog
for more information on why I created this extension.
Usage
This library helps you reduce the number of external resources to load by allowing you to embed external resources via a Twig extension. You can use this extension to embed resources like fonts, stylesheets, scripts etc.
<link rel="stylesheet" href="{{ embed(asset('/styles.css')) }}"> <style> @font-face { font-family: 'SCP'; font-weight: normal; src: url('{{ embed('https://fontlibrary.org/scp.ttf') }}'); } </style>
Installation
Use Composer to install the library.
$ composer require endroid/embed
When you use Symfony, the installer
makes sure that services are automatically wired.. If this is not the case you
can find the configuration files in the .install/symfony
folder.
Versioning
Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatible changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading.
License
This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.