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 Slide

  2. Sheraton-MeetingRooms

    View Slide

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

    • symfony developer since ’06/’07

    • PHPBenelux/PFZ.nl/PHPAmersfoort

    • Ingewikkeld / Techademy

    View Slide

  4. Before we get started

    View Slide

  5. https://joind.in/10662

    View 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 Slide

  7. 1

    View Slide

  8. Choose your
    framework

    View Slide

  9. 2

    View Slide

  10. Once upon a time…

    View Slide

  11. And they lived happily…

    View Slide

  12. 3

    View Slide

  13. http://symfony.com/download

    View Slide

  14. php composer.phar

    create-project

    symfony/framework-standard-edition

    myProject/ 2.4.4

    View Slide

  15. View Slide

  16. View Slide

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

    View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. 4

    View Slide

  23. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View Slide

  24. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View Slide

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

    View Slide

  26. Structure
    Application

    View Slide

  27. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View Slide

  28. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View Slide

  29. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View Slide

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

    View Slide

  31. Structure
    Bundle

    View Slide

  32. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View Slide

  33. Structure
    Application
    Bundle Bundle Library
    Library
    Bundle Bundle

    View Slide

  34. Structure
    Library

    View Slide

  35. Structure
    Library
    • 3rd party libraries
    • Wrappers

    View Slide

  36. The src/ directory

    View Slide

  37. app/console
    generate:bundle

    View Slide

  38. View Slide

  39. View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. 5

    View Slide

  44. View Slide

  45. app/console
    doctrine:generate:entity

    View Slide

  46. View Slide

  47. View Slide

  48. View Slide

  49. app/console
    doctrine:generate:crud

    View Slide

  50. app/console
    doctrine:generate:crud

    View Slide

  51. View Slide

  52. View Slide

  53. View Slide

  54. 6

    View Slide

  55. View Slide

  56. View Slide

  57. View Slide

  58. View Slide

  59. 7

    View Slide

  60. Forms are objects

    View Slide

  61. View Slide

  62. View Slide

  63. View Slide

  64. 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 Slide

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

    View Slide

  66. Questions?

    View Slide

  67. https://joind.in/10662

    View Slide