Symfony 6 & Custom Bundle - tutorial how to create (best practices)

  Рет қаралды 6,058

Tanya WebDev

Tanya WebDev

Күн бұрын

From this tutorial you'll learn how to create a Custom Bundle in Symfony 6 App. Also I'll tell about best practices.
❗Semantic Versioning Standard: semver.org/
❗Site to generate a license file based on the options you select: choosealicense...
🌟 Symfony 6 tutorials playlist: • Symfony 6 - The contro...
💡 You can support the channel on Patreon: / tatyana_webdev
___
You can find me on:
LinkedIn: / tatyana-webdev
#TanyaWebDev #coding #php #symfony #symfony6 #symfonyCustomBundle #symfony6CustomBundle #symfonyTutorial

Пікірлер: 14
@SiphoMkhwanazi
@SiphoMkhwanazi 4 ай бұрын
Great video, I love your explanation. I am creating plugins for Sylius e-commerce.
@quanchi88
@quanchi88 Жыл бұрын
Thanks. This helped me to finally make my first bundle work
@tanyawebdev
@tanyawebdev Жыл бұрын
(⌒‿⌒) I'm glad the video was useful to you!
@project-lu3qv
@project-lu3qv Жыл бұрын
Great tutorial thanks
@evgeniichornyi678
@evgeniichornyi678 Жыл бұрын
Thanks, great video
@tanyawebdev
@tanyawebdev Жыл бұрын
Thanks! :)
@damienollivier5541
@damienollivier5541 Жыл бұрын
Great tutorial thank you. Do you know if there is a way to automatically create/import the route file into the app route folder when the bundle is installed ?
@tanyawebdev
@tanyawebdev Жыл бұрын
Yes, there are several ways to automatically create or import a route file into the app route folder when installing a Symfony bundle: 1. Using the "KernelEvents::BUNDLE_POST_INSTALL_EVENT" event - Create a listener for the KernelEvents::BUNDLE_POST_INSTALL_EVENT event. - In the event listener, check if the installed bundle is your custom bundle. - If it is, get the path to your bundle's route file. - Copy or import the route file into the app route folder. - You can use Symfony's built-in functions, such as file_put_contents() or $router->import(), to perform the copying or importing. 2. Using the Symfony Flex autoloading system - Create a composer.json file in your bundle and specify the autoload.psr-4 section with your bundle's namespace. - Place the route file in the folder specified in the autoload.psr-4 section. - Symfony Flex will automatically load the route file when the bundle is installed. - Make sure that the route file uses absolute paths for the routes so that they are registered correctly. 3. Using a Symfony Console command - Create a Symfony Console command that performs the copying or importing of the route file. - Add the command to the scripts section of your bundle's composer.json file. - Run the composer run command after installing the bundle to launch the script and import the routes. 4. Using the "BundleImporter" package - Install the "BundleImporter" package with Composer. - Create a configuration file for the package, specifying the path to your bundle's route file and the app route folder. - When the bundle is installed, the "BundleImporter" package will automatically import the route file. --- Which method to choose depends on your preferences and project requirements. - Method 1 is the most flexible but requires writing an event listener. - Method 2 is simpler to implement but requires using Symfony Flex and absolute paths in the route file. - Method 3 is convenient for creating separate commands for managing routes but requires additional code. - Method 4 uses a third-party package, which may be simpler but adds a dependency.
@damienollivier5541
@damienollivier5541 Жыл бұрын
@@tanyawebdev thank you for your answer. I'm gonna try all the methods just for fun but I think I'm gonna use the first one, I find it more elegant and it seems to suit the needs of my project. thank you for your hard work your chanel Is a gold mine.
@tanyawebdev
@tanyawebdev Жыл бұрын
@@damienollivier5541 Thank you for your kind words, it inspires me to move on! :)
@aliakbarmohajeruni
@aliakbarmohajeruni Жыл бұрын
Help me Use captach symfony 7 but notfound or is old package Suggest captach?
@AlexD-lc2nx
@AlexD-lc2nx Жыл бұрын
Good tutorial format but there are no entities, bundle config building etc.
@scheidegg
@scheidegg 5 ай бұрын
No repo?
@杨志-n6z
@杨志-n6z Жыл бұрын
great tutorial,how to use bundle make CRUD?
TOP 9 terminal commands for Debugging Symfony 6 App
32:21
Tanya WebDev
Рет қаралды 762
React Tutorial for Beginners
1:20:04
Programming with Mosh
Рет қаралды 3,9 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Think Fast, Talk Smart: Communication Techniques
58:20
Stanford Graduate School of Business
Рет қаралды 44 МЛН
Symfony 6 Создание своего bundle
9:12
WEB men
Рет қаралды 1,5 М.
Create a Symfony 6.2 Bundle and upload it to Packagist
9:56
Mustafa Özyurt
Рет қаралды 2,6 М.
OAuth 2.0 and OpenID Connect (in plain English)
1:02:17
OktaDev
Рет қаралды 1,8 МЛН
Where Does Bad Code Come From?
42:21
Molly Rocket
Рет қаралды 214 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН