WEBVTT

NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com

00:00:00.056 --> 00:00:04.036 align:middle
Well hey guys!

00:00:04.366 --> 00:00:04.796 align:middle
You know what?

00:00:05.056 --> 00:00:09.946 align:middle
I'm pumped that you're learning Symfony,
because it's the hardest framework ever!

00:00:10.776 --> 00:00:12.276 align:middle
Relax, I'm kidding.

00:00:12.346 --> 00:00:16.756 align:middle
Symfony does have a reputation for being
tough to learn, but this is a trap!

00:00:17.336 --> 00:00:19.276 align:middle
Or at least, it's an outdated idea.

00:00:20.006 --> 00:00:25.756 align:middle
Look: Symfony can be incredibly simple and
will put you in a position to write powerful,

00:00:25.996 --> 00:00:29.966 align:middle
well-designed code, whether it's
for an API or a traditional web app.

00:00:30.426 --> 00:00:35.156 align:middle
And when it does get a bit more difficult, it's
usually because you're learning best practices

00:00:35.156 --> 00:00:38.716 align:middle
and object oriented goodness that's
turning you into a better developer.

00:00:39.466 --> 00:00:40.266 align:middle
So what is Symfony?

00:00:40.806 --> 00:00:45.026 align:middle
First, it's a set of components:
meaning PHP libraries.

00:00:45.026 --> 00:00:48.656 align:middle
Actually, it's about 30 small libraries.

00:00:49.366 --> 00:00:52.676 align:middle
That means that you could use Symfony
in your non-Symfony project today

00:00:52.676 --> 00:00:54.596 align:middle
by using one of its little libraries.

00:00:55.246 --> 00:00:57.316 align:middle
One of my favorites is called Finder:

00:00:57.976 --> 00:01:01.196 align:middle
it's really good at searching
deep into directories for files.

00:01:02.076 --> 00:01:05.906 align:middle
But Symfony is also a framework where
we've taken all of those components

00:01:06.076 --> 00:01:09.356 align:middle
and glued them together for so that
you can get things done faster.

00:01:09.356 --> 00:01:14.336 align:middle
This series is all about doing amazing
things with the Symfony framework.

00:01:14.336 --> 00:01:17.306 align:middle
Let's get our first Symfony project rolling.

00:01:18.776 --> 00:01:21.336 align:middle
Head over to Symfony.com and click 'Download'.

00:01:22.056 --> 00:01:24.426 align:middle
Our first task is to get the Symfony Installer.

00:01:25.286 --> 00:01:28.996 align:middle
Depending on your system, this means
running commands from one of these boxes.

00:01:29.136 --> 00:01:33.226 align:middle
Since I'm on a mac, I'll copy the curl
command and paste it into the terminal:

00:01:37.836 --> 00:01:41.306 align:middle
Copy the second command and run
that to adjust some permissions:

00:01:42.316 --> 00:01:45.776 align:middle
This gives us a new symfony
executable: But hold on!

00:01:46.066 --> 00:01:49.486 align:middle
This is not Symfony, it's the Symfony Installer:

00:01:49.856 --> 00:01:55.236 align:middle
a tiny utility that makes it really
easy to start new Symfony projects.

00:01:55.236 --> 00:01:55.926 align:middle
Let's start one!

00:01:56.486 --> 00:01:59.816 align:middle
Run symfony new and then
the name of the project.

00:02:00.346 --> 00:02:04.216 align:middle
Call the project aqua_note: I'll
tell you more about it soon.

00:02:04.216 --> 00:02:08.926 align:middle
In the background this is downloading
a new Symfony project, unzipping it,

00:02:09.356 --> 00:02:13.096 align:middle
making sure your system is
configured, warning you of any problems

00:02:13.316 --> 00:02:17.376 align:middle
and then dropping the new files
into this aqua_note directory.

00:02:17.776 --> 00:02:27.016 align:middle
Not bad! Move into the directory
and check it out.

00:02:29.036 --> 00:02:33.366 align:middle
This is also not Symfony: it's
just a set of files and directories

00:02:33.366 --> 00:02:37.166 align:middle
that form a web app that
use the Symfony libraries.

00:02:37.676 --> 00:02:41.906 align:middle
Those libraries - along with other third-party
code - live in the vendor/ directory.

00:02:42.636 --> 00:02:45.706 align:middle
Before I explain the other directories,
let's get this thing working!

00:02:46.246 --> 00:02:53.236 align:middle
Run: to start the built in PHP web server.

00:02:54.096 --> 00:02:59.626 align:middle
Yes, you can also use Nginx or Apache:
but this is much easier for development.

00:03:00.336 --> 00:03:03.506 align:middle
When you're done later, just
hit Ctrl+C to stop the server.

00:03:04.346 --> 00:03:08.096 align:middle
As the comment says here, go to
http://localhost:8000 in your browser.

00:03:08.096 --> 00:03:12.606 align:middle
And boom! Congrats!

00:03:12.936 --> 00:03:16.386 align:middle
This is your first page being
executed by the Symfony framework.

00:03:16.946 --> 00:03:21.356 align:middle
That's right: this is being rendered dynamically
from the files inside of your project.

00:03:21.846 --> 00:03:27.816 align:middle
At the bottom, you'll see one of the best
features of Symfony: the web debug toolbar.

00:03:28.236 --> 00:03:31.656 align:middle
This is full of debugging
information - more on that later.

00:03:32.446 --> 00:03:34.856 align:middle
Ok, let's start building our own pages!

