wiki:members/GRIP-UQAM/Symfony

Version 42 (modified by Grip Uqam, 7 years ago) ( diff )

--

Symfony

Related Page

Versions

3.3

Dependency Injection

Debugging

Bugs

Bugs as such cannot be reported. They have to be brought to light in a development version of Symfony with strong arguments and it is recommended to correct them on a fork and to make a pull request. So it may be better to go around at first development time and to correct only then really needed. 2017-01

Templating

There is a problem using twig array loader in Symfony framework, template including for statement produce an error. Tested in 2.8.16 and 3.2.2. symfony/templating

Form

(Warning: Form concentrates a huge quantity of issues in Symfony. It seems best to favor use of long term version (LTS) of Symfony then using this component.)

  • In version 3.2.2, the instructions in the official manual for separate component use result in no form beeing displayed, with Whoops an uninformative error can be obtained. It has not been tested if symfony/debug component can see something.
  • In 2.8 instructions are different and it works, the API seems to have change between versions.

symfony/form

Symfony Programming

Tutorials

Software using Symfony

EZ Plateform

Symfony Programming Tools

Hacking

autoload.php

MicroKernel

Components

Some popular Components

Console

http://phppackages.org/p/symfony/console/badge/rank.svg https://www.versioneye.com/php/symfony:console/reference_badge.svghttps://img.shields.io/packagist/dm/symfony/console.svg

...

Yaml

https://www.versioneye.com/php/symfony:yaml/reference_badge.svghttps://img.shields.io/packagist/dm/symfony/yaml.svg

...

Finder

https://www.versioneye.com/php/symfony:finder/reference_badge.svghttps://img.shields.io/packagist/dm/symfony/finder.svg

...

EventDispatcher

https://www.versioneye.com/php/symfony:event-dispatcher/reference_badge.svghttps://img.shields.io/packagist/dm/symfony/event-dispatcher.svg

...

https://packagist.org/packages/symfony/

https://www.versioneye.com/php/symfony:yaml/reference_badge.svghttps://img.shields.io/packagist/dm/symfony/yaml.svg

...

Dependency Injection

Form

HttpFoundation

PSR-7

Routing

nikic/fast-route vs symfony/routing
RouteCollection vs RouteCollectionBuilder

RouteCollection

RouteCollectionBuilder

add(string $name, Route $route)

$this addRoute(Route $route, string|null $name = null)

Route add(string $path, string $controller, string|null $name = null

new RouteCollection()->add('root', new Route('/', [
    '_controller' => 'FrameworkBundle:Redirect:redirect',
    'route'       => 'sonata_admin_dashboard',
    'permanent'   => true,
])); // to check
new RouteCollectionBuilder()->addRoute(new Route('/', [
    '_controller' => 'FrameworkBundle:Redirect:redirect',
    'route'       => 'sonata_admin_dashboard',
    'permanent'   => true,
]),
    'root'
); // to check

Does not exist: cf $loader->import(...)

RouteCollectionBuilder import(mixed $resource, string|null $prefix = '/', string $type = null)

Does not exist: cf addCollection

mount($prefix, RouteCollectionBuilder $builder)

$collection = new RouteCollection();
$routing = $loader->import(
    "@SonataAdminBundle/Resources/config/sonata_admin.xml"
);
$routing->setPrefix('/admin');
$collection->addCollection($routing);
$routes->mount('/admin', $routes->import('@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'));

Written for 3.0

(Dynamic and Auto) Routing

(Bundles depends on components)

More about Routing

Security

Guard (New in 2.8!)

Use in Symfony framework

Stopwatch (also on PHP page)

Translation

Bundles

symfony/framework-standard-edition

Choosing bundles

Bundles not to choose

Admin: sonata-project/admin-bundle

Admin without Admin Bundle

Form related

Default value

(Other) Bundles documented by symfony.com

The list is there: http://symfony.com/doc/bundles/

Social Login

OAuth
HybridAuth
OpenID
Feed
Translation sonata-project/translation-bundle
Tree

Tree

Tag and Taxonomy

News, Newsletter

Spatial search

Blog

Payment

Help Desk, Bug Tracking and Ticket

CLI code generation example

$ php bin/console generate:bundle --namespace=AppBundle --bundle-name=AppBundle --format=annotation --dir=../src --no-interaction
$ php bin/console assets:install ../web --symlink --relative
$ php bin/console doctrine:generate:entity --entity="AppBundle:Category" --fields="name:string(255)" --no-interaction
$ php bin/console doctrine:generate:entity --entity="AppBundle:BlogPost" --fields="title:string(255) body:text draft:boolean" --no-interaction
$ php bin/console doctrine:schema:create
$ php bin/console doctrine:schema:update # after modification

See

  • sensio/generator-bundle
  • doctrine/orm

Symfony - Kotti

Note: See TracWiki for help on using the wiki.