Version 37 (modified by 7 years ago) ( diff ) | ,
---|
- Symfony
- Related Page
- Debugging
-
Bugs
- Templating
- Form
-
Symfony Programming
- Tutorials
- Software using Symfony
- Symfony Programming Tools
- Hacking
- MicroKernel
- Components
- Bundles
- CLI code generation example
- Symfony - Kotti
Symfony
Related Page
Debugging
- How to Optimize your Development Environment for Debugging
- symfony/debug The Debug component provides tools to ease debugging PHP code. (since Symfony 2.3) [Seems very PHP specific.]
- symfony/debug-bundle [What does it do?]
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 Programming
- http://fr.slideshare.net/AcquiaInc/create-a-symfony-application-from-a-drupal-perspective
- https://www.youtube.com/results?search_query=symfony
- https://www.youtube.com/results?q=knpuniversity
Tutorials
- Débuter avec Symfony 3 : Créer sa première page web Abdel-Farid SALAMI 2016
- Jobeet Tutorial with Symfony2 fr
- DevAndClick YouTube
- Create your own PHP Framework
- Journey to the Center of Symfony: HttpKernel Request-Response
- Journey to the Center of Symfony: The Dependency Injection Container
- SF3C4 | Web Development with Symfony 3
- Symfony Certification
- Going Async in Symfony Controllers
Software using Symfony
EZ Plateform
- EZ Plateform and Symfony Article from Symfony Finland
- https://packagist.org/packages/ezsystems/ezplatform
- http://share.ez.no/downloads/downloads
- https://doc.ez.no/display/TECHDOC/Requirements (Postgres install not yet supported 2016-04)
- https://doc.ez.no/display/TECHDOC/Using+Composer
Symfony Programming Tools
Hacking
autoload.php
- https://github.com/symfony/symfony-standard/blob/master/app/autoload.php The original
- https://github.com/symfony-cmf/standard-edition/blob/master/app/autoload.php Almost the same, maybe slightly older version
- https://github.com/symfony-cmf/cmf-sandbox/blob/master/app/autoload.php Locale component additions and others
MicroKernel
- http://symfony.com/blog/new-in-symfony-2-8-symfony-as-a-microframework
- https://symfony.com/doc/current/cookbook/configuration/micro-kernel-trait.html
- https://www.youtube.com/results?search_query=symfony+microkernel
- https://knpuniversity.com/screencast/new-in-symfony3/micro-kernel
- https://www.youtube.com/results?search_query=micro+symfony
- http://knpuniversity.com/screencast/micro-symfony
Components
Some popular Components
... | ||
... | ||
... | ||
... | ||
... |
Dependency Injection
Form
HttpFoundation
- The HttpFoundation Component
- Making the Locale "Sticky" during a User's Session See Translation component.
PSR-7
- PSR-7 Support in Symfony is Here
- The PSR-7 Bridge
- symfony/psr-http-message-bridge
- PSR-7: HTTP message interfaces
- An introduction to PSR-7 in Symfony Marek Pietrzak 2016
- PSR-7 et Symfony Nacera Boucetta 2016
Routing
RouteCollection vs 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
Security
Guard (New in 2.8!)
- symfony/security-guard
- How to Create a Custom Authentication System with Guard
- https://symfony.com/doc/current/components/security.html
Use in Symfony framework
- https://knpuniversity.com/screencast/guard *
- https://www.sitepoint.com/easier-authentication-with-guard-in-symfony-3/
- http://www.sensiolabsblog.co.uk/blog/symfony-security-component-guard-tutorial
- http://silex.sensiolabs.org/doc/master/cookbook/guard_authentication.html
- knpuniversity/oauth2-client-bundle
- Upgrade from KNP Guard bundle to Symfony Guard component
Stopwatch (also on PHP page)
Translation
- The Translation Component
- Making the Locale "Sticky" during a User's Session See HttpFoundation component.
- see Bundle-Form-Translation
- see Bundle-Admin-Translation
Bundles
symfony/framework-standard-edition
- https://github.com/symfony/symfony-standard
- https://github.com/symfony/symfony-standard/blob/master/app/AppKernel.php
- symfony/framework-bundle FrameworkBundle - The core Symfony framework bundle
- Some components may sometimes be required
- symfony/console (for console)
- symfony/process (for console server:run)
- symfony/validator
- symfony/expression-language
- symfony/psr-http-message-bridge
- zendframework/zend-diactoros
- Some components may sometimes be required
- SensioFrameworkExtraBundle fr- Adds several enhancements, including template and routing annotation capability
- If you plan to use or create annotations for controllers, make sure to update your
autoload.php
by adding the following line...
- If you plan to use or create annotations for controllers, make sure to update your
- doctrine/doctrine-bundle DoctrineBundle - Adds support for the Doctrine ORM
- doctrine/orm has to be required if needed
- Dependency injection:
- Extensions:
- https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html
- knplabs/doctrine-behaviors
- a2lix/translation-form-bundle
- a2lix/i18n-doctrine-bundle
- prezent/doctrine-translatable-bundle doctrine-translatable/doc/getting-started.md
- Translate/Internationalize your Doctrine entities with ease - Custom backend and Sonata compatible
- https://github.com/a2lix/Demo
- TwigBundle - Adds support for the Twig templating engine
- symfony/security-bundle SecurityBundle - Adds security by integrating Symfony's security component
- symfony/security may need to be also required
- symfony/swiftmailer-bundle SwiftmailerBundle - Adds support for Swiftmailer, a library for sending emails
- monolog-bundle MonologBundle - Adds support for Monolog, a logging library
- WebProfilerBundle (in dev/test env) - Adds profiling functionality and the web debug toolbar
- SensioDistributionBundle (in dev/test env) - Adds functionality for configuring and working with Symfony distributions
- sensio/generator-bundle SensioGeneratorBundle fr (in dev/test env) - Adds code generation capabilities
- Choosing the annotation format expects the SensioFrameworkExtraBundle to be installed
- There should be one line of imports in the
config.yml
file! (otherwise changes may not be added to it!) - Generating a New Bundle Skeleton
- in composer.json (for autoload):
"autoload": { "psr-4": { "": "src/" } }
$ php bin/console generate:bundle --namespace=AppBundle --bundle-name=AppBundle --format=annotation --dir=../src --no-interaction Bundle generation > Generating a sample bundle skeleton into app/../src/AppBundle OK! > Checking that the bundle is autoloaded: OK > Enabling the bundle inside /...app/AppKernel.php: OK > Importing the bundle\'s routes from the app/config/routing.yml file: OK > Importing the bundle\'s services.yml from the app/config/config.yml file: OK Everything is OK! Now get to work :).
- files touched:
- app/../src/AppBundle (directory and content generated)
- app/AppKernel.php
- app/config/routing.yml
- app/config/config.yml (see note about line of import)
- in composer.json (for autoload):
- DebugBundle (in dev/test env) - Adds Debug and VarDumper component integration
Choosing bundles
Bundles not to choose
- jms/serializer (Why is there a bug in it?)
- Do not use FOSUserBundle (Read on KNP University how to use it with "Guard")
Admin: sonata-project/admin-bundle
- sonata-project/admin-bundle
- symfony.com sonata-project.org
- sonata-project/doctrine-orm-admin-bundle sonata-project.org
- sonata-project/doctrine-phpcr-admin-bundle
- sonata-project/doctrine-mongodb-admin-bundle
- http://stackoverflow.com/questions/22916083/sonata-admin-bundle-adding-link-to-related-entities-in-configure-list
Admin without Admin Bundle
- fork CMS
- Episode 22 - Créer une administration avec Symfony2 (fr)
Form related
Default value
- keyword: sonata admin getnewinstance
- https://sonata-project.org/bundles/admin/master/doc/cookbook/recipe_custom_action.html
- https://stackoverflow.com/questions/10546168/setting-default-value-in-symfony2-sonata-admin-bundle
(Other) Bundles documented by symfony.com
The list is there: http://symfony.com/doc/bundles/
- Admin sonata-project/admin-bundle symfony.com cmf/tutorial
- ApiDoc nelmio/api-doc-bundle symfony.com
- Assetic (No more distributed with Symfony Standard Edition) symfony/assetic-bundle doc/current/assetic.html
- Cache -> Doctrine - Cache
- CKEditor ckeditor-bundle egeloen/ckeditor-bundle symfony.com may be used with helios-ag/fm-elfinder-bundle
- Create symfony-cmf/create-bundle cmf/bundles/create requires symfony/framework-bundle...
- Doctrine
- Cache doctrine/doctrine-cache-bundle symfony.com
- Extensions stof/doctrine-extensions-bundle symfony.com .../common_extensions
- Fixtures doctrine/doctrine-fixtures-bundle symfony.com fr
- Migrations doctrine/doctrine-migrations-bundle symfony.com
- MongoDB doctrine/mongodb-odm-bundle symfony.com
- PHPCR doctrine/phpcr-bundle cmf
- Editor -> CKEditor
- Imagine liip/imagine-bundle symfony.com
- JsRouting friendsofsymfony/jsrouting-bundle symfony.com
- Menu knplabs/knp-menu-bundle symfony.com
- REST friendsofsymfony/rest-bundle symfony.com
- Routing symfony-cmf/routing-bundle cmf
- User friendsofsymfony/user-bundle symfony.com Do not use FOSUserBundle maybe better see https://knpuniversity.com/screencast/symfony-security
- site:symfony.com/doc/master/bundles
Social Login
- https://en.wikipedia.org/wiki/Social_login
- See Guard component
OAuth
- hwi/oauth-bundle
- friendsofsymfony/oauth-server-bundle (server)
- http://knpuniversity.com/screencast/oauth
- https://www.youtube.com/results?search_query=oauth
- See Guard component knpuniversity/oauth2-client-bundle
HybridAuth
- based on hybridauth/hybridauth NOTE: HybridAuth is in maintainance mode. Although pull requests from the community are still accepted, you should find alternatives if you are starting a new project. HA is getting outdated by the day and there are no official plans to work on HybridAuth.
- azine/hybridauth-bundle
- sllh/hybridauth-bundle
- itlized/social
- See Guard component
OpenID
- fp/openid-bundle based on lightopenid/lightopenid which is almost unsupported.
- writtengames/openid-user-bundle
- raphox/alb-open-id-server-bundle (server)
- See Guard component (no openid guard bundle (march 2017))
Feed
- keyword: symfony rss atom
- eko/feedbundle A Symfony bundle to build RSS feeds from entities (based on zend-feed)
- debril/rss-atom-bundle
Translation sonata-project/translation-bundle
- sonata-project.org
- see Doctrine-Extensions-Translatable
- see Bundle (Component)-Form-Translation
Tree
Tree
- symfony-cmf/tree-browser-bundle
- http://www.codeproject.com/Tips/418196/Editing-Tree-Structures-in-Symfony
- http://knpbundles.com/keyword/tree-symfony-bundle
Tag and Taxonomy
News, Newsletter
Search
- Symfony and Search: Lucene, Solr and Elasticsearch
- Solarium
- PHP zendframework/zendsearch
- egeloen/lucene-search-bundle
- liip/search-bundle (Google's search API)
- symfony-cmf/search-bundle
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