The Symfony documentation

Overview

The official Symfony Documentation

Online version | Screencasts

Contributing

We love contributors! For more information on how you can contribute to the Symfony documentation, please read Contributing to the Documentation

Note All pull requests must be based on the 4.4 branch, unless you are documenting a feature that was introduced after Symfony 4.4 (e.g. in Symfony 5.2), not the 5.x or older branches.

SymfonyCloud

Thanks to SymfonyCloud for providing an integration server where Pull Requests are built and can be reviewed by contributors.

Docker

You can build the documentation project locally with these commands:

# build the image...
$ docker build . -t symfony-docs

# ...and start the local web server
# (if it's already in use, change the '8080' port by any other port)
$ docker run --rm -p 8080:80 symfony-docs

You can now read the docs at http://127.0.0.1:8080 (if you use a virtual machine, browse its IP instead of localhost; e.g. http://192.168.99.100:8080).

Comments
  • add more published doc formats (pdf, epub)

    add more published doc formats (pdf, epub)

    The documentation strategy (instead of a large book, the Symfony2 documentation is split into small chapters about specific topics); Fabien Potencier http://symfony.com/blog/symfony2-documentation

    i think, it would be very important to also create and provide the symfony2 docs in "book" form -> pdf / epub.

    why?

    • no, we don't have a internet connection everywhere
    • ebook reader doesn't handle rst
    • for people who want to print it out
    • ...

    of course the format of the symfony docs opens all doors to do it myself (http://symfony.com/doc/2.0/contributing/documentation/format.html), i only need Sphinx and then i can create pdfs. wait, i have to install rst2pdf. easy

    ImportError: No module named setuptools
    http://www.happylife.sg/index.php/2010/04/25/importerror-no-module-named-setuptools/
    

    and so on...

    what i want to say is, that its not a 5 minute act to create a pdf and if i just want to learn a framework it doesn't mean i want to learn how to convert rst in pdf (or have the time to).

    it would be a great thing, to add the conversion to pdf/epub to the docment website build/deploy process, so the problem is solved one time and the users of symfony can focus on symfony instead of building pdf files.

    before anyone answer with "we don't need that", "it is ok how it is",... don't forget we are talking about digital/virtual stuff, so if i would ask to print a book in paperback insted of hardcover this would be a decision where only one way would be possible course you can if you look at the costs but in the virtual world we just can deploy both with nearly no overhead. we don't need to choose between this or that way, we can take both ways at the same time.

    to provide a one (all the docs) or three (book, cookbook, components) file(s) doc would really help to use it mobile.

    please help the developers to keep focus on developing with php and symfony not sphinx and other stuff.

    Website 
    opened by c33s 91
  • Remove references to entity generation, replace by proper entity modelling

    Remove references to entity generation, replace by proper entity modelling

    Hello,

    there are lots of users using doctrine:generate:entities nowadays. This must stop.

    Symfony should provide its large user base decent article on designing/modelling entities in a proper way, with business methods and as few setters as possible, not by generating them from database. Such generated entities lead to a tediously known anemic domain model, something that does more harm than good: breaks encapsulation and completely undermines the purpose of ORM. It'd probably be even better to not use ORM at all and use DBAL directly, the result would be very similar without runtime overhead.

    Note that Doctrine 3.0 will remove support for code generation entirely, so the better we educate the users, the better.

    This issue is a direct response to discussion in doctrine/DoctrineBundle#729.

    Thanks.

    Waiting feedback 
    opened by Majkl578 80
  • [RFC] The Symfony Console Style Guide

    [RFC] The Symfony Console Style Guide

    This is the proposal for the new Symfony Console Style Guide. Please review it as soon as you can, because the schedule is pretty tight. We'd like to update most of the commands for Symfony 2.6 version.

    Download Symfony Console Style Guide (PDF, 89 KB)

    good first issue actionable Console 
    opened by javiereguiluz 64
  • [Cookbook][Cache] Added config example for Varnish 4.0

    [Cookbook][Cache] Added config example for Varnish 4.0

    | Q | A | | --- | --- | | Doc fix? | [yes] | | New docs? | [no] | | Applies to | [all] | | Fixed tickets | [] |

    After upgrading to Varnish 4.0, I've noticed the documentation was not really up-to-date anymore:

    • according to https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.html#req-not-available-in-vcl-backend-response,

      beresp is available in vcl_backend_response

    • according to https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.html#hit-for-pass-objects-are-created-using-beresp-uncacheable,

      hit_for_pass objects are created via beresp.uncacheable

    Would this addition be enough in order to consider the documentation up-to-date in accordance with Varnish 4.0 upgrading guidelines?

    Status: Reviewed 
    opened by thierrymarianne 51
  • Using the new template naming in the documentation

    Using the new template naming in the documentation

    The other day, @lyrixx and I were talking about Twig template naming and locations and he asked if we could update the official Symfony documentation to use the new template syntax.

    Imagine that your project has the following four templates:

    your-project/
     ├─ app/
     │  └─ Resources
     │     └─ views/
     │        └─ template1.twig
     ├─ src/
     │  └─ Acme/
     │     └─ Bundle/
     │        └─ DemoBundle/
     │           └─ Resources
     │              └─ views/
     │                 ├─ template2.twig
     │                 └─ Default/
     │                    ├─ template3.twig
     │                    └─ common/
     │                       └─ template4.twig
     ├─ vendor/
     └─ web/
    

    Using the traditional syntax, you have four different formats to explain:

    ::template1.twig
    AcmeDemoBundle::template2.twig
    AcmeDemoBundle:Default:template3.twig
    AcmeDemoBundle:Default:common/template4.twig
    

    Using the new namespaced syntax everything is straightforward:

    template1.twig
    @AcmeDemoBundle/template2.twig
    @AcmeDemoBundle/Default/template3.twig
    @AcmeDemoBundle/Default/common/template4.twig
    

    With the new syntax you only have to write the path from Resources/views/, without thinking if the template is associated with a controller or if it's stored in a subdirectory. Everything is much easier to explain, specially for Symfony newcomers.

    Forgetting for a moment about the colossal effort that would be needed to update all the documentation, what do you think about this proposal?

    Templating DX Waiting feedback 
    opened by javiereguiluz 45
  • With multiple Entity Managers (EM) the Repository uses only the mapped EM for the Entity

    With multiple Entity Managers (EM) the Repository uses only the mapped EM for the Entity

    In the manual page How to Work with multiple Entity Managers and Connections for Symfony 4, we can see in the end the following code snippet:

            // Retrieves a repository managed by the "customer" em
            $customers = $this->getDoctrine()
                ->getRepository(Customer::class, 'customer')
                ->findAll()
            ;
    

    Using the ORM configuration code indicated in the beginning of that document, where the Customer entity is mapped to the 'customer' entity manager, the 'customer' parameter for the getRepository() method is ignored. As so, this last code about repository calls should be updated.

    Also, I suggest to add the code on how to use multiple entity managers for a single Entity, or to add a note that it's not possible if that's the case.

    actionable Doctrine 
    opened by bigs21 42
  • [DependencyInjection] Fluent PHP DI Documentation

    [DependencyInjection] Fluent PHP DI Documentation

    • Updated service_container.rst to include php-fluent-di
    • Updated _build/conf.py to include codeblock for php-fluent-di
    • Updated existing di resource loading to refer to latest sf 4.2 excludes

    Remaining: need to update the rest of the service_container files

    Signed-off-by: RJ Garcia [email protected]

    DependencyInjection DX Status: Reviewed 
    opened by ragboyjr 38
  • Twig template naming convention

    Twig template naming convention

    Correct me if I am wrong, but Symfony2 documentation does not specify if filename of Twig template should be written in camelCase (articleDetails.html.twig) or with underscores (article_details.html.twig).

    In Symfony naming conventions is note:

    Use alphanumeric characters and underscores for file names;

    But in Including other templates doc section is mentioned template filename in camel case: articleDetails.html.twig

    In the majority of open source bundles there are underscores used in template filenames (for example Sonata, KnpPaginatorBundle,MopaBootstrapBundle, GenemuFormBundle, AdmingeneratorGeneratorBundle), but some use camelCase filenames (FOSFacebookBundle) or they mix it together (for example FOSUserBundle, FOSMessageBundle).

    So what`s the recommended way? This should be clearly explained in documentation.

    Also Twig coding standars should be linked somewhere in documentation: http://twig.sensiolabs.org/doc/coding_standards.html

    opened by pulzarraider 35
  • Document how to

    Document how to "integration" test private services

    Question:

    What if you do container->get() some services in tests.

    Answer:

    The proper solution would be to create a public alias for the service you want to test in the test environment only:

    # app/config/config_test.yml
    services:
        test_alias.AppBundle\Service\MyService:
            alias: 'AppBundle\Service\MyService'
            public: true # require on SF4, where everything is private by default
    

    Then, you would actually fetch test_alias.AppBundle\Service\MyService out of the container in your unit test. It's a nice idea too: you only need to expose your service as public in the test environment.

    DependencyInjection 
    opened by weaverryan 34
  • [WIP]  Added DBAL session storaged based on PDO Session storage page

    [WIP] Added DBAL session storaged based on PDO Session storage page

    | Q | A | | --- | --- | | Doc fix? | no | | New docs? | yes | | Applies to | 2.1 | | Fixed tickets | #881 |

    I added a quick reference to https://github.com/symfony/symfony/blob/2.1/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php basing it almost completely on the PDO Session handler

    I'm merging it into this branch, even though it's not mantained anymore, because this is where this option became available to use for session storage

    Status: Needs Work 
    opened by xocasdashdash 34
  • [Cache] Memcached Adapter Docs and Cache Pool Docs Refactoring

    [Cache] Memcached Adapter Docs and Cache Pool Docs Refactoring

    Documentation for symfony/symfony#20863 and symfony/symfony#20858. PR symfony/symfony#20863 is still being written/finalized, so this is a WIP following that PR at this time. Resolves #7256.

    Status: Reviewed 
    opened by robfrawley 33
  • [ExpressionLanguage] Add `enum` expression function

    [ExpressionLanguage] Add `enum` expression function

    Related to https://github.com/symfony/symfony/pull/48669.

    :information_source: I added a namespace to the enum in the example to kind of remind that quadruple backslashes must be used in the expression to use the namespaced enum.

    ExpressionLanguage Status: Needs Review Waiting Code Merge 
    opened by alexandre-daubois 0
  • Remove not needed tip from 'How to Upload Files'

    Remove not needed tip from 'How to Upload Files'

    When creating a form to edit an already persisted item, the file form type still expects a :class:Symfony\\Component\\HttpFoundation\\File\\File instance.

    The file form type is not mapped so it doesn't matter.

    $product->setBrochureFilename() this expects a string, not a File instance.

    Actually when you edit already persisted item you don't need to pass anything to $product->setBrochureFilename() since this field is not actually in the form type and it won't get handled (which is fine). The suggested tip is not needed.

    Status: Needs Review 
    opened by nacholibre 0
  • Best practices for the suffix of form class names

    Best practices for the suffix of form class names

    Hello,

    It would be interesting to have the best practice for the suffix of form class names. For example, would it be /src/Form/TaskType.php or /src/Form/TaskFormType.php? I find the 2 suffixes on the internet:

    • https://github.com/the-fast-track/book-6.2-1/blob/main/src/Form/CommentFormType.php
    • https://github.com/symfony/demo/blob/main/src/Form/CommentType.php

    Then we may be able to modify the Forms section of the Best Practices page.

    opened by seb-jean 0
  • [Validator] Add `getConstraint()` method to `ConstraintViolationInterfa…

    [Validator] Add `getConstraint()` method to `ConstraintViolationInterfa…

    | Q | A | ------------ | --- | Feature PR | symfony/symfony#48671 | PR author(s) | @syl20b | Merged in | 6.3

    We created this issue to not forget to document this new feature. We would really appreciate if you can help us with this task. If you are not sure how to do it, please ask us and we will help you.

    To fix this issue, please create a PR against the 6.3 branch in the symfony-docs repository.

    Thank you! :smile:

    Validator 
    opened by fabpot 2
Symfony React Blank is a blank symfony and react project, use this template to start your app using Symfony as an backend api and React as a frontend library.

Symfony React Blank Symfony React Blank is a blank symfony and react project, use this template to start your app using Symfony as an backend api and

Antoine Kingue 2 Nov 5, 2021
The Symfony documentation

The official Symfony Documentation Online version | Screencasts Contributing We love contributors! For more information on how you can contribute to t

Symfony 2k Dec 30, 2022
[DEPRECATED -- Use Symfony instead] The PHP micro-framework based on the Symfony Components

Silex, a simple Web Framework WARNING: Silex is in maintenance mode only. Ends of life is set to June 2018. Read more on Symfony's blog. Silex is a PH

Silex 3.6k Dec 22, 2022
Bugsnag notifier for the Symfony PHP framework. Monitor and report errors in your Symfony apps.

Bugsnag exception reporter for Symfony The Bugsnag Notifier for Symfony gives you instant notification of errors and exceptions in your Symfony PHP ap

Bugsnag 43 Nov 22, 2022
OpenAPI(v3) Validators for Symfony http-foundation, using `league/openapi-psr7-validator` and `symfony/psr-http-message-bridge`.

openapi-http-foundation-validator OpenAPI(v3) Validators for Symfony http-foundation, using league/openapi-psr7-validator and symfony/psr-http-message

n1215 2 Nov 19, 2021
Fork of Symfony Rate Limiter Component for Symfony 4

Rate Limiter Component Fork (Compatible with Symfony <=4.4) The Rate Limiter component provides a Token Bucket implementation to rate limit input and

AvaiBook by idealista 4 Apr 19, 2022
Enter-to-the-Matrix-with-Symfony-Console - Reproduction of the "Matrix characterfall" effect with the Symfony Console component.

Enter to the Matrix (with Symfony Console) Reproduction of the "Matrix characterfall" effect with the Symfony Console component. Run Clone the project

Yoan Bernabeu 23 Aug 28, 2022
Airbrake.io & Errbit integration for Symfony 3/4/5. This bundle plugs the Airbrake API client into Symfony project

AmiAirbrakeBundle Airbrake.io & Errbit integration for Symfony 3/4/5. This bundle plugs the Airbrake API client into Symfony project. Prerequisites Th

Anton Minin 8 May 6, 2022
Simple Symfony API-Platform Template which you can use to start to develop with symfony and api-platform

symfony-api-platform-skeleton Simple Template for Symfony API You can fork it and change the git remote to your Repo git remote set-url <your-git-remo

null 1 Jan 23, 2022
Dockerise Symfony Application (Symfony 6 + Clean Architecture+ DDD+ CQRS + Docker + Xdebug + PHPUnit + Doctrine ORM + JWT Auth + Static analysis)

Symfony Dockerise Symfony Application Install Docker Install Docker Compose Docker PHP & Nginx Create Symfony Application Debugging Install Xdebug Con

null 48 Jan 5, 2023
documentation for the oauth2-server-php library

OAuth2 Server PHP Documentation This repository hosts the documentation for the oauth2-server-php library. All submissions are welcome! To submit a ch

Brent Shaffer 227 Nov 24, 2022
Documentation Generator for PHP

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Dec 28, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Dec 22, 2022
An API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

null 2k Dec 17, 2022
Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)

phpDox phpDox is a documentation generator for PHP projects. This includes, but is not limited to, API documentation. The main focus is on enriching t

Arne Blankerts 588 Dec 22, 2022
A php API documentation generator, fork of Sami

Doctum, a PHP API documentation generator. Fork of Sami Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documenta

Code LTS 203 Dec 21, 2022
📖 The Nette documentation

How to contribute Nette welcomes contributions. You are free to make changes or translate existing pages. Before contributing, please read information

Nette Foundation 108 Dec 14, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Apr 20, 2021
Generates documentation for your REST API from annotations

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Nelmio 2.1k Jan 6, 2023
A platform to create documentation/wiki content built with PHP & Laravel

BookStack A platform for storing and organising information and documentation. Details for BookStack can be found on the official website at https://w

BookStackApp 10.6k Jan 3, 2023