nyrodev / utility-bundle
Utility Bundle for Symfony, provide many shortcut and useful functionnalities
Package info
github.com/nyroDev/UtilityBundle
Type:symfony-bundle
pkg:composer/nyrodev/utility-bundle
Requires
- nyrodev/php-template-bundle: dev-master
- symfony/framework-bundle: ^7
- symfony/templating: ^7
Suggests
- becklyn/ordered-form-bundle: Used for form positionning
- embed/embed: Required to use EmbedService
- sabberworm/php-css-parser: Required to use rem2px command
- slim/psr7: Required to use EmbedService, or any other PS7 implementation
- tinymce/tinymce: Required to use TinymceType
This package is auto-updated.
Last update: 2026-06-19 10:20:56 UTC
README
Using form twig template
Add in config/packages/twig.yaml
twig: form_themes: - '@NyroDevUtility/Form/nyrodev_form_div_layout.html.twig'
Using TinymceType
Add tinymce to your dependancies:
composer require tinymce/tinymce
Add tinymce depency your webpack encore config:
.addPlugin(new CopyWebpackPlugin({ patterns: [ {from: 'vendor/tinymce/tinymce', to: '../tinymce'} ] }))
Translate Tinymce
Require tinymce npm dependancy:
npm i tinymce-i18n
Then copy the language file you need by adding to your webpack encore config:
.addPlugin(new CopyWebpackPlugin({ patterns: [ {from: 'vendor/tinymce/tinymce', to: '../tinymce'}, {from: 'vendor/nyrodev/utility-bundle/Resources/public/js/filemanager', to: '../tinymce/plugins/filemanager'}, {from: 'node_modules/tinymce-i18n/langs8/fr-FR.js', to: '../tinymce/langs/'}, { from: 'node_modules/tinymce-i18n/langs8/fr-FR.js', to: '../tinymce/langs/fr.js', transform: (input, filename) => { return input.toString().replace('tinymce.addI18n("fr-FR", {', 'tinymce.addI18n("fr", {'); } } ] }))
Using tinymce browser feature
Add JS and CSS generation to your webpack encore config:
.addEntry('css/admin/tinyBrowser', './vendor/nyrodev/utility-bundle/Resources/public/css/tinyBrowser/index.css') .addEntry('js/admin/tinyBrowser', './vendor/nyrodev/utility-bundle/Resources/public/js/tinyBrowser/index.js')
Add tinymce plugins depency your webpack encore config:
.addPlugin(new CopyWebpackPlugin({ patterns: [ {from: 'vendor/tinymce/tinymce', to: '../tinymce'}, {from: 'vendor/nyrodev/utility-bundle/Resources/public/js/filemanager', to: '../tinymce/plugins/filemanager'}, {from: 'node_modules/tinymce-i18n/langs8/fr-FR.js', to: '../tinymce/langs/'}, { from: 'node_modules/tinymce-i18n/langs8/fr-FR.js', to: '../tinymce/langs/fr.js', transform: (input, filename) => { return input.toString().replace('tinymce.addI18n("fr-FR", {', 'tinymce.addI18n("fr", {'); } } ] }))
Create a route for the browser page, in config/routes/browser.yaml:
Be sure to protect this route behind a security firewall!
tiny_browser: path: "%adminPrefix%/tinyBrowser/{type}/{dir}" controller: NyroDev\UtilityBundle\Controller\TinymceController::browserAction defaults: dir: null requirements: dir: '.+'
If you want to enable on every TinymceType by default:
nyro_dev_utility: browser: defaultEnable: true defaultRoute: 'tiny_browser' allowAddDir: true
Using resize assets URL
Simply import this in your config/routes/nyrodev.yaml:
nyrodev_assets: resource: "@NyroDevUtilityBundle/Resources/config/routingAssets.yaml"
Then you can use the nyrodev_assets_resize route.