Version 25 (modified by 8 years ago) ( diff ) | ,
---|
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
- Jobeet Tutorial with Symfony2 fr
- DevAndClick YouTube
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
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
Translation
- The Translation Component
- Making the Locale "Sticky" during a User's Session See HttpFoundation component.
- see Bundle-Form-Translation
- see Bundle-Admin-Translation
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
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
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
- 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
Admin 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
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
HybridAuth
- azine/hybridauth-bundle
- sllh/hybridauth-bundle
- itlized/social
- See Guard component
OpenID
- fp/openid-bundle
- writtengames/openid-user-bundle
- raphox/alb-open-id-server-bundle (server)
- See Guard component
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
Symfony - Kotti
Note:
See TracWiki
for help on using the wiki.