Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build your first Symfony2 application (PHP[tek] 2014)

Build your first Symfony2 application (PHP[tek] 2014)

During this tutorial, you will get started with the Symfony2 framework, and build your first web application using the framework. We'll cover installation, configuration, bundles, controllers, working with the database and forms during this tutorial, and if we have some time left, we can go beyond those basic topics as well.

Stefan Koopmanschap

May 20, 2014
Tweet

More Decks by Stefan Koopmanschap

Other Decks in Technology

Transcript

  1. Build your first
    Symfony2 application

    View full-size slide

  2. Sheraton-MeetingRooms

    View full-size slide

  3. /about
    • PHP developer since ’97/’98

    • symfony developer since ’06/’07

    • PHPBenelux/PFZ.nl/PHPAmersfoort

    • Ingewikkeld / Techademy

    View full-size slide

  4. Before we get started

    View full-size slide

  5. https://joind.in/10662

    View full-size slide

  6. Today
    1. Choosing your framework

    2. Some history

    3. Creating your project

    4. Creating your first Hello World

    5. Connecting to the database

    6. Working with Twig

    7. Working with forms

    View full-size slide

  7. Choose your
    framework

    View full-size slide

  8. Once upon a time…

    View full-size slide

  9. And they lived happily…

    View full-size slide

  10. http://symfony.com/download

    View full-size slide

  11. php composer.phar

    create-project

    symfony/framework-standard-edition

    myProject/ 2.4.4

    View full-size slide

  12. chmod -R 777
    app/cache app/logs

    View full-size slide

  13. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View full-size slide

  14. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View full-size slide

  15. Structure
    Application
    • Configuration
    • Bootstrap
    • Global templates
    • Dependencies

    View full-size slide

  16. Structure
    Application

    View full-size slide

  17. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View full-size slide

  18. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View full-size slide

  19. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View full-size slide

  20. Structure
    Bundle
    • Controllers
    • Entities
    • Views
    • Configuration
    • Forms
    • Related code

    View full-size slide

  21. Structure
    Bundle

    View full-size slide

  22. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View full-size slide

  23. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View full-size slide

  24. Structure
    Library

    View full-size slide

  25. Structure
    Library
    • 3rd party libraries
    • Wrappers

    View full-size slide

  26. The src/ directory

    View full-size slide

  27. app/console
    generate:bundle

    View full-size slide

  28. app/console
    doctrine:generate:entity

    View full-size slide

  29. app/console
    doctrine:generate:crud

    View full-size slide

  30. app/console
    doctrine:generate:crud

    View full-size slide

  31. Forms are objects

    View full-size slide

  32. Today
    1. Choosing your framework

    2. Some history

    3. Creating your project

    4. Creating your first Hello World

    5. Connecting to the database

    6. Working with Twig

    7. Working with forms

    View full-size slide

  33. http://www.phparch.com/magazine/2013-2/september/

    View full-size slide

  34. https://joind.in/10662

    View full-size slide