• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Symfony 2 Best Practices
 

Symfony 2 Best Practices

on

  • 1,724 views

This is my slide for Drupal 8 Meetup. The practices are collected from my working and managing experience on Symfony 2 throughout my projects.

This is my slide for Drupal 8 Meetup. The practices are collected from my working and managing experience on Symfony 2 throughout my projects.

Statistics

Views

Total Views
1,724
Views on SlideShare
1,721
Embed Views
3

Actions

Likes
6
Downloads
17
Comments
0

1 Embed 3

https://twitter.com 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Symfony 2 Best Practices Symfony 2 Best Practices Presentation Transcript

    • Symfony 2 Best Practices Speaker: Bao Nguyen bao.nguyen@semantics.vn 10/13/2013
    • 10/13/2013
    • Why Symfony 2.3? Why best practices? 10/13/2013
    • Code Standard • PSR-0, PSR-1, PSR-2 • Bundle Structure Best Practices • Bundle namespace: • SmvnSomeCoolBundle • SmvnBundleSomeCoolBundle • SmvnBundleSmvnSomeCoolBundle • Service naming, Route naming • Prefix with bundle name and vendor name (for reusable bundle) • Use service alias (image_resizer vs. smvn_image_resizer) 10/13/2013
    • Only commit your own code • • • • • • • • • • • /.idea /nbproject /composer.phar /vendor /app/config/parameters.yml /app/cache /app/logs /app/phpunit.xml *.php~ /web/bundles /web/uploads 10/13/2013
    • Tools • Manage Assets (js+css) with Assetic • Sensio Framework Extra • Security Component (Firewall, Users, ACL …) • Twig • Doctrine Extension • Console component • PHPUnit / Behat • Configuration system (DI & Parameters) • Jenkins Jobs for PHP (http://jenkins-php.org/) 10/13/2013
    • Reusability • Template inheritance • Template macro • Twig Extension • Base Controller / Embed Controller • Service • Form Type • Bundle (try knpbundles.com) • Extract bundle from project for reusability 10/13/2013
    • Pitfall • Security Context: isGranted() vs. hasRole() • Event Listener vs. Event Subscriber • Doctrine Schema Update vs. Doctrine Schema Migration • app/cache, app/logs write-permission: Never use umask • Nesting limit in xdebug • Case sensitive Annotation name (@Entity vs @entity) • Avoid using dev-master in composer.json • Update vendor  Clear cache  Clear Assetics  Update schema 10/13/2013
    • Thank you for listening! bao.nguyen@semantics.vn 10/13/2013