Skip to content

Instantly share code, notes, and snippets.

@navitronic
Created July 10, 2012 06:32
Show Gist options
  • Save navitronic/3081592 to your computer and use it in GitHub Desktop.
Save navitronic/3081592 to your computer and use it in GitHub Desktop.
Melbourne SF2 July Meetup

Agenda:

  • Introductions / etc
  • Lightning 5 min talk about Symfony 2.1 by Sam J

Coding exercise - Build a blog

  1. Make sure that Symfony is working and you have the default vendors installed on your laptop / environment
  2. Find and run app/console
  3. Use app/console to generate a bundle for you to work with tonight
  4. Think about your entity model. What would a simple blog need as a bare minimum. (posts / comments / tags / categories etc)
  5. Now build out the post entity (start with post, add user and others later)
  6. Add a repository for posts
  7. Input some dummy data via phpmyadmin or similar
  8. Create a controller that will deal with loading posts.
    • Create an action to list out posts in reverse chronological order and associated twig view
    • Create an action to show a single post with associated twig view
    • Link between them.
  9. Expand entity model to include comments. Associate users and comments
  10. Add comment form to single post page (Use Symfony forms component)
    • Process, validate and save comments
    • Display comments on single post page
  11. Expand with other functionality (create posts... security etc etc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment