Simplify your professional web development with symfony

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

6 comments

Comments 1 - 6 of 6 previous next Post a comment

  • + guestd224d1 guestd224d1 8 months ago
    It’s great. The documentation is very good and customization is even better. I wonder about some of the comments.
  • + guest763a4a guest763a4a 2 years ago
    The person saying that symfony is time wasting, is totally anaware even with the basis of symfony.



    Only draw back with symfony is that there is a learning phase. And if you want to use symfony without learning it and without understaning its basics then please don’t waste your time.



    But once you learn its basics you can do 3-4 months work easily in one month.



    And my friends you wiill get answers to all of your questions.



    Want documentation.... visite www.symfony-project.org and don’t search here and there... only the book is sufficient.
  • + faisalshabbir faisalshabbir 2 years ago
    some of these comments are true. But still it is very interesting for work.
  • + guest591c44 guest591c44 2 years ago
    symfony is programers hell!

    the ducmentation is horrible

    costumization is impossible

    time saving? huh - time waisting
  • + guest418cc2 guest418cc2 2 years ago
    yes i am ..

  • + nrauni nrauni 3 years ago
    good apresentation!!

    i’m studing symfony now, and i like much it..

    thank you

Post a comment
Embed Video
Edit your comment Cancel

Notes on slide 1

I'm François Zaninotto, manager at Sensio Labs, co-author of sf and main author of sf doc today’s presentation : how to simplify your professional web development with symfony why we created symfony 3 years ago. main selling points of symfony. features that makes symfony a good framework for your next project.

18 Favorites & 3 Groups

Simplify your professional web development with symfony - Presentation Transcript

  1. symfony Simplify your professional web development with PHP Francois Zaninotto http://www.symfony-project.com/ http://www.sensio.com/
  2. Professional
  3. Professional
    • Heavyweight, complex
    • Very expensive
    • Full Featured
    • Performant
    • Extensible
    • Documented
    • Supported
    • Configurable
    • Stable
    • Easy to use
    • Java Struts
    • Microsoft .Net
    • Symfony
  4. PHP for professionals
    • Stable
    • Performant
    • Documentation
    • Object-oriented (as of PHP5)
    • Cheap and efficient Hosts
    • Support
    • Libraries
    • Developers for hire
    • Easy
    • Cheap
    • Large Community
  5. PHP for professionals
    • Stable
    • Performant
    • Documentation
    • Object-oriented (as of PHP5)
    • Cheap and efficient Hosts
    • Support
    • Libraries
    • Developers for hire
    • Easy
    • Cheap
    • Large Community
    Bad reputation Spaghetti code Amateur coding Reinventing the wheel BC breaks Inconsistent syntax Bloated … PHP4
  6. Develop faster
    • Each line of code has a cost
      • To write the line
      • To test it
      • To maintain it
    • Write less code
      • Architecture : contr o ller, ORM, …
      • Configuration
      • Autoloading
      • Generators
      • Helpers
    • More time for business rules, edge cases, …
    less code  less complexity  less bugs  more productivity  more time
  7. Don’t reinvent the wheel
    • Follow best practices
    • Object orientation
    • MVC Pattern : Model / View / Contr oller
    • Object-Relational Mapping / Active Record
    • Unit and functional tests
    • Agile development
    simplify your life
  8. Professionals need more than PHP alone
    • a PHP framework?
  9. Professionals need more than PHP alone
    • a PHP framework?
  10. Many of them lack…
    • Tests
    • Stability
    • Support
    • Security
    • Examples
    • Liberal license
    • Documentation
    • Critical user mass
    • Multi-platformness
    • DB engines support
    • Not suitable for professionals
  11. Sensio
    • French Web Agency
    • Founded 9 years ago
    • 200 web projects
    • 30 people
    • Faith in open-source
    • Demanding clients
    • Objectives: Have fun
            • Make money
    Webmarketing Open Source Technologies (Framework PHP) Web Technologies SENSIO Web Agency
  12. The challenge
    • Bring together
    • the Enterprise world
    • and the Open-Source world
  13. symfony
    • PHP 5 Web Framework
    • Based on 9 years of Sensio experience
    • Based on well-known projets (Mojavi, Propel, Prado)
    • Open-Source
    • Built for :
      • Professional Websites
      • Complex needs
      • Demanding environments
    Licence MIT Bring together Entreprise World Open-Source World
  14. What makes the difference
    • Documentation
    • Configurability
    • XSS protection
    • Debugging tools
    • Functional tests
    • Extensibility : Plugins
    • Admin Generator
    • ORM : Propel or Doctrine
    • i18n / l10n
    • 1.0 maintained for a long time
    Standard PHP 5 MVC Routing Cache
  15. Installation is a breeze
    • PEAR
    • $ pear channel-discover pear.symfony-project.com
    • $ pear install symfony/symfony-1.0.0
    • SVN / symlink
    • $ svn propedit svn:externals
    • symfony http://svn.symfony-project.com/branches/1.0
    • Sandbox
    • $ curl -O http://www.symfony-project.com/get/sf_sandbox-1.0.0.tgz
    • $ tar zxpf sf_sandbox-1.0.0.tgz
    easy fast recommended
  16. Directory structure generation
    • $ mkdir ~/sfdemo
    • $ cd ~/sfdemo
    • $ symfony init-project sfdemo
    • $ ./symfony init-app frontend
    Project  Application(s)  Module(s)  Action(s) Composant(s)  Template
  17.  
  18. Database connection settings
    • # config/databases.yml
    • prod :
    • propel:
    • param:
    • password: PAssWD
    • all :
    • propel:
    • class: sfPropelDatabase
    • param:
    • dsn: mysql://root:@localhost/sfdemo
    Environment support
  19. Database schema definition
    • # config/schema.yml
      • post:
      • title: { type: varchar, size: 255 }
      • content: { type: longvarchar }
      • is_published: { type: boolean }
      • author_id: { type: integer, foreignTable: author ,
      • foreignReference: id }
      • created_at: ~
    SQL abstraction
  20. Test data
    • # data/fixtures/data.yml
    • Author:
    • fabien :
    • first_name: Fabien
    • last_name: Potencier
    • Post:
    • first_post:
    • author_id: fabien
    • title: Xtech 2007
  21. Generate the thing
    • $ ./symfony propel-build-all-load frontend
    1) Creates model classes 2) Converts schema to SQL 3) Creates tables 4) Loads test data
  22. Model
    • // lib/model/Author.php
    • class Author extends BaseAuthor
    • {
    • function getFullName()
    • {
    • return $this -> getFirstName(). ' ' .$this -> getLastName();
    • }
    • }
    • $author = new Author();
    • $author -> setFirstName( 'Fabien' );
    • $author -> setLastName( 'Potencier' );
    • $author -> save();
    • $post = new Post();
    • $post -> setAuthor($author);
    • $post -> setPublishedOn( '12:00 tomorrow' );
    • $post -> isPublished( true );
    • $post -> save();
    • $posts = PostPeer :: doSelect(new Criteria());
    ORM Object Relationship Mapping Propel / Doctrine
  23. Backend creation
    • Automatic creation of an Administration Backend, ready for production
      • Lists
      • Pagination
      • Sorting
    • $ ./symfony propel-init-admin frontend post Post
      • Filters
      • Validation
      • CRUD
    1) Creates a post module 2) Generates configuration Generated code is MVC and customizable Configuration file Contr oller Templates
  24. Configurability
    • Module level
    • # apps/frontend/modules/post/config/generator.yml
    • generator:
    • class: sfPropelAdminGenerator
    • param:
    • model_class: Post
    • list :
    • display: [ =title , author, created_at]
    • filters : [title, author_id, published_on]
    • max_per_page: 5
    • Application level
    • # apps/frontend/config/security.yml
    • default:
    • is_secure: on
    • credentials: admin
    • $ ./symfony plugin-install http://plugins.symfony-project.com/ sfGuardPlugin
    Configuration Framework Project Application Module LOC : 0
  25. Admin Generator – list view
  26. Admin Generator – edit view __toString() widgets m2m relationship
  27. Extensibility
    • Module extension
    • class postActions extends autoPostActions
    • {
    • protected function addFiltersCriteria($c)
    • {
    • parent :: addFiltersCriteria($c);
    • $c -> add(PostPeer :: IS_PUBLISHED, true );
    • }
    • }
    • Template customization
    Generated module _edit_* : actions, footer, form, header, messages _list_* : footer, header, messages, td_actions, t(d|h)_stacked, t(d|h)_tabular _filters, editSuccess, listSuccess
  28. Frontend Creation
    • Routing
    <?php echo link_to( $post -> getTitle(), '@post?id=’ .$post -> getId() ) ?> post : param: { module: blog, action: show } requirements: id: d+ url: /blog/:id.html <?php echo url_for( '@homepage' ) ?> homepage : param: { module: blog, action: recent } url: / homepage : param: { module: blog, action: list } url: / recent : param: { module: blog, action: recent } url: /recent /blog/1.html / / /recent
  29. Functional Tests
    • Simulate navigation and make smart assertions
    • // test/functional/frontend/blogActionsTest.php
    • $browser = new sfTestBrowser();
    • $browser -> initialize();
    • $browser ->
    • get( '/blog/1.html' ) ->
    • isStatusCode( 200 ) ->
    • checkResponseElement( 'h1.title' , '/XTech 2007/' );
      • $ ./symfony test-functional frontend
      • # get /
      • ok 1 - status code is 200
      • not ok 2 - response selector h1 does not match regex /XTech 2007/
      • # Looks like you failed 1 tests of 2
      • 1..2
    TDD Test Driven Development CSS Selector
  30. Our first line of code
    • # apps/frontend/modules/blog/actions/actions.class.php
    • class blogActions extends sfActions
    • {
    • function executeShow()
    • {
    • $id = $this -> getRequestParameter( 'id' );
    • $this -> post = PostPeer :: retrieveByPk($id);
    • $this -> forward404Unless($this -> post);
    • }
    • }
    • # apps/frontend/modules/post/templates/showSuccess.php
    • <h1 class= &quot;title&quot; ><?php echo $post -> getTitle() ?></h1>
    • <h2>par <?php echo $post -> getAuthor() -> getFullName() ?></h2>
    • <p><?php echo $post -> getHtmlContent(ESC_RAW) ?></p>
    MVC Model / View / Contr oller XSS Secure by default shortcut
  31. Debugging tools – The web debug toolbar
  32. Debugging tools – Meaningful error messages
  33. Deployment
    • $ ./symfony test-all
    • functional/frontend/postActionsTest...................... ok
    • All tests successful.
    • Files=1, Tests=2
    • # config/properties.ini
    • [production]
    • host= 1.2.3.4
    • user= fabien
    • dir= /var/www/sfblog
    • type= rsync
    • $ ./symfony sync production go
    $ ./symfony freeze
  34. Once it is in production
    • Optimized for speed and stability
    • Internals never shown
    • Logs rotation
    • Data dumping
    • 404/500 error logging
    • Incremental updates (via rsync)
  35. Community Plugins
    • Hooks in the symfony code allow for easy extension
    • New plugins are created every week
      • Doctrine : Full Doctrine ORM support
      • UJS : Unobtrusive JavaScript
      • PropelActAsNestedSetBehavior : Nested sets for Propel
      • PropelActAsTaggableBehavior : Easy tags for Propel
      • SuperCache : HTML pages cache
      • ControlPanel : Web management for symfony projects
      • ErrorLogger : All 404 and 500 logging in a table
      • Guard : Authentication and authorization features
      • Feed2 : Web feeds management (read&write)
      • PokaYoke : Client side validation
  36. A Professional Web Framework
    • Built from experience
    • Clean, modular and customizable code
    • 1.0 stable, maintained with commercial support
    • Growing community
      • Developpers in more than 80 countries
      • 100 000 visitors per month on symfony-project.com
    • Open-Source Documentation
      • The book (450 pages - GFDL)
      • Askeet Tutorial (250 pages)
  37. Do you need a second opinion?
    • Yahoo! (USA)
    • Yahoo! Bookmarks
    • 20 millions users
    • Web 2.0 / AJAX
  38. What’s next?
    • Forge : www.symfony-forge.com
    • New features for symfony 1.1
      • More hooks for plugins
      • More modularity
      • Official Doctrine support
      • Unobstrusive JavaScript support
      • New form and validation framework
    • Book translation
    中文 , Deutsch, Español, Français Polski, Russian, 日本語 , Italiano, …
  39. How to make money with open-source?
    • Sensio Labs provides symfony-focused services
      • Training
      • Code auditing
      • Consulting
      • Web development
    • If you are looking for a job in France, we're hiring
    • SENSIO S.A.
    • 26, rue Salomon de Rothschild
    • 92 286 SURESNES cedex
    • FRANCE
    • Tél. : +33 1 40 99 80 80
    • Fax : +33 1 40 99 83 34
    • Contact
    • Francois Zaninotto
    • http://www.sensio.com/ http://www.symfony-project.com/

+ Francois ZaninottoFrancois Zaninotto, 3 years ago

custom

7565 views, 18 favs, 6 embeds more stats

Learn how symfony can make your life simple, especi more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 7565
    • 7534 on SlideShare
    • 31 from embeds
  • Comments 6
  • Favorites 18
  • Downloads 501
Most viewed embeds
  • 18 views on http://www.phpcamp.nl
  • 7 views on http://kaloyan.info
  • 3 views on http://www.agglom.com
  • 1 views on http://ixenio.com
  • 1 views on http://www.w3frameworks.com

more

All embeds
  • 18 views on http://www.phpcamp.nl
  • 7 views on http://kaloyan.info
  • 3 views on http://www.agglom.com
  • 1 views on http://ixenio.com
  • 1 views on http://www.w3frameworks.com
  • 1 views on http://www.brijj.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories

Groups / Events