Archived video

This video is archived and won't be updated. We're keeping it online for now as a courtesy.

Alternate resources: 

Start a Symfony 3 Project

Video loading...

  • 0:04
    Start a Symfony 3 Project Ryan Weaver
  • 0:08
    Well, hey, guys. You know what?
  • 0:09
    I am pumped that you're learning Symfony
  • 0:12
    because it's the hardest framework ever.
  • 0:15
    Relax, I'm kidding.
  • 0:17
    Symfony does have a reputation for being tough to learn,
  • 0:20
    but this is a trap or at least it's an outdated idea.
  • 0:24
    Look, Symfony can be incredibly simple.
  • 0:27
    And will put you in a position to write powerful,
  • 0:30
    well-designed code, whether it's for an API or a traditional web app.
  • 0:35
    And when it does get a bit more difficult,
  • 0:37
    it's usually because you're learning best practices
  • 0:40
    in object oriented goodness
  • 0:41
    that's turning you into a better developer.
  • 0:44
    So what is Symfony?
  • 0:45
    First, it's a set of components
  • 0:47
    which is our way of saying PHP libraries.
  • 0:51
    Actually it's about 30 small libraries.
  • 0:53
    That means that you could use Symfony in your non-Symfony projects today
  • 0:57
    by using one of its little libraries.
  • 1:00
    Actually, one of my favorites is called Finder.
  • 1:02
    It's really good at searching deep into directories for different files.
  • 1:06
    But Symfony is also a framework where we've taken all of those components
  • 1:10
    and glued them together for you
  • 1:12
    so that you can get things done faster.
  • 1:14
    This series is all about doing amazing things
  • 1:17
    with the Symfony framework.
  • 1:20
    Let's get our first Symfony project rolling.
  • 1:23
    Head over to Symfony.com and click DOWNLOAD.
  • 1:26
    Our first task is to get the Symfony Installer.
  • 1:30
    Depending on your system, this means running commands
  • 1:32
    from one of these boxes.
  • 1:34
    Since I'm on a Mac, I'll copy the curl command
  • 1:36
    and paste into the terminal.
  • 1:42
    Copy the second command and run that to adjust some permissions.
  • 1:47
    This gives us a new Symfony executable.
  • 1:49
    But hold on, this is not Symfony,
  • 1:52
    it's the Symfony Installer,
  • 1:54
    a tiny utility that makes it really easy to start new Symfony projects.
  • 1:59
    So let's start one.
  • 2:01
    Run symfony new and then the name of the project.
  • 2:05
    Call this project aqua_note.
  • 2:07
    I'll tell you more about it soon.
  • 2:09
    In the background, this is downloading a new Symfony project,
  • 2:12
    unzipping it, making sure your system is configured,
  • 2:16
    warning you of any problems and then dropping the new files
  • 2:20
    into this aqua_note directory.
  • 2:22
    Not bad.
  • 2:23
    The project name aqua_note
  • 2:25
    is only used to determine the directory name.
  • 2:27
    It's not important at all afterwards.
  • 2:30
    Move into the directory and check it out.
  • 2:33
    This is also not Symfony.
  • 2:36
    It's just a set of files and directories that form a web app
  • 2:39
    that uses the Symfony libraries.
  • 2:42
    Those libraries, along with other third party code
  • 2:45
    live in the vendor directory.
  • 2:47
    Before I explain the other directories,
  • 2:49
    let's get this thing working.
  • 2:50
    Run php bin/console server:run
  • 2:55
    to start the built-in PHP web server.
  • 2:58
    Yes, you can of course also use NGINX or Apache,
  • 3:02
    but this is much easier for development.
  • 3:05
    When you're done later, just hit Control-C to stop the server.
  • 3:09
    As the comment says here, go to localhost:8000 in your browser.
  • 3:15
    And boom! Congrats.
  • 3:17
    This is your first page being executed by the Symfony framework.
  • 3:21
    That's right.
  • 3:22
    This is being rendered dynamically
  • 3:24
    from the files inside of your project.
  • 3:27
    At the bottom, you'll see one of the best features of Symfony,
  • 3:30
    the Web Debug Toolbar.
  • 3:32
    This is full of debugging information,
  • 3:35
    but more on that later.
  • 3:36
    OK.
  • 3:38
    Let's start building our own pages.

Start a Symfony 3 Project

Loading...

In this lesson, you will learn how to get a Symfony 3 project started. First download Symfony and then follow along with this video tutorial.

Downloads: 
Log in or sign up to download companion files.
Additional resources: