Skip to content

Instantly share code, notes, and snippets.

@BillClinton
Last active August 1, 2019 18:35
Show Gist options
  • Save BillClinton/04aa2bb80f64fccccec2fece742578d3 to your computer and use it in GitHub Desktop.
Save BillClinton/04aa2bb80f64fccccec2fece742578d3 to your computer and use it in GitHub Desktop.
Symfony notes

run project: php -S 127.0.0.1:8000 -t public

better server, install: composer require server

then: ./bin/console server:run


Annotations let you put the routes in the comments above the controller functions. Install:

composer require annotations

then:

  /**
   * @Route("/news/{slug}");
   */
  public function show($slug) {
    return new Response('ArticleController:show:' . $slug);
  }

Flex

Symfony Recipes Server: https://symfony.sh

shows aliases for flex

Recipes

Whenever you install a package, Flex will execute the recipe for that package if there is one. Recipes can add configuration files, create directories or modify files (like .gitignore)


TWIG


Profiler

composer require profiler --dev composer require debug --dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment