diff --git a/README.md b/README.md index 7d86b34..c2fff0a 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,14 @@ wget fbot.co/nysymfony bash nysymfony YOUR_PROJECT_NAME rm nysymfony cd YOUR_PROJECT_NAME -sudo docker-compose up -d ``` The next steps to take would be: 1. Verify the ```.env``` and ```docker-compose.md``` file -1. start docker -1. Create your controllers -1. Create your security +1. start docker ```sudo docker-compose up -d``` +1. [Create your controllers](https://git.gopo.li/nick/symfony/src/branch/main/docs/Controller.md) +1. [Create your security](https://git.gopo.li/nick/symfony/src/branch/main/docs/Security.md) # Currently supported and tested on diff --git a/bin/nysymfony b/bin/nysymfony index f1184f6..41cd708 100755 --- a/bin/nysymfony +++ b/bin/nysymfony @@ -75,7 +75,7 @@ echo "SASS installed you still need to run sass sass/$1.sass public/css/main.css composer req symfony/process composer req asset -composer req annotations +composer req sensio/framework-extra-bundle ################################################################################ # Symfony development bundles diff --git a/docs/Bundles.md b/docs/Bundles.md index 9df92e8..42c0acd 100644 --- a/docs/Bundles.md +++ b/docs/Bundles.md @@ -2,3 +2,23 @@ ## How to Create a bundle +[Official Symfony Docs - Create a bundle](https://symfony.com/doc/current/bundles.html#creating-a-bundle) + +mkdir -p lib/bundleName/src +touch lib/bundleName/src/bundleName.php + +You have to add the namespace\bundle name to config/bundles.php +```vendorName\bundleName\bundleName::class => ['all' => true],``` + +And you have to auto load the class by adding the next line in composer.json: +``` +"autoload": { + "psr-4": { + "vendorName\\bundleName\\": "lib/bundleName/src/", + "App\\": "src/" + } + }, +``` +(replace vendorName\bundleName and make sure the directory is correct) + +run ```composer dump-autoload``` after updating the composer.json \ No newline at end of file diff --git a/docs/Console.md b/docs/Console.md index afe29ac..28a75b6 100644 --- a/docs/Console.md +++ b/docs/Console.md @@ -15,5 +15,8 @@ php bin/console security:hash-password # Composer Cheat Sheet composer dump-autoload + +To view the namespaces symfony creates for twig: +php bin/console debug:twig ## Installed Recipes Use ```composer recipes``` to see which bundles you have installed.