Starting in Symfony2: Course 1 (2.4+)
Transform into a Symfony2 whiz by building a real-life application as you learn about routing, controllers, and more!
About this course
Get your first Symfony2 project off on the right foot, with the right tools, best practices and tips. If you're serious about getting into Symfony2, this course is for you!
In this screencast, we start building a real events application from the ground-up, touching on and discussing the most fundamental parts of the application. Specifically, we'll cover:
- Installation, Git and Setup
- Composer
- Routing
- Controllers
- Introduction to the service container
- Twig
- Doctrine
- Server setup
- Code generation
- Fixtures & external libraries
- And other tips and tricks
Next courses in the Symfony 2: Starting in Symfony 2 section of the Symfony 2 Track!
157 Comments
Hi m0j0_j0j0!
Thanks for the comment, it's helpful to know what people are thinking, and especially your thoughts about it being too presentation-ish. Perhaps we'll experiment in the future with some different formats and see how they feel. When we do, I'd love your feedback :).
Cheers!
Hi Kamedan - what kind of issue are you seeing? Feel free to use the contact us page to send us more details :)
Hey Lucas,I had the same problem...if you guys someday found out how to setup vhost for windows 8, just let please everybody know...I will do the same for sure.
Meanwhile let's go to the second screencast! Love the frst one, good job!
My god, embarrassing! Thanks for the tip - I've fixed this (https://github.com/knpunive... and gotten it deployed right away!
Cheers!
Love the screencasts! Will you offer additional formats along with .mov?
Hey Tim! What other format are you looking for? :)
I find that the .flv at 480p files that I download from some youtube screencasts have been the most bandwidth/size friendly. It would be nice to have that as a download option.
completely new with composer, when running install I get this, while in the process of cloning doctrine/common (2.3.x-dev bb0aebb) :
[Symfony\Component\Process\Exception\RuntimeException]
The process timed out.
any suggestions on how I could circumvent this issue?
aside from downloading the without vendors tarball and running install inside it which, oddly, went about smoothly installing the vendors
Sorry, I can't get it. Is it 12$ for the whole course, or 12$ per episode?
Hi Дмитрий! It is $12 per episode - except for episode 4 which is $4 if you buy the entire series. Hope that helps!
Are you going to make more videos for 2.4+? Something more in-depth than the beginner setup. For instance real world uses and projects created using Symfony 2.4?
Definitely - we're trying to do about one a month - so episode 2 is up next! Not a lot has changed really, so if you go through the tutorials now, you'll already be in great shape.
Cheers!
If I get the 2.2. version do I still need to pay another 12 dollars for the 2.4?
Absolutely not :) - if you buy the 2.2 version, you'll get the 2.4 version for free when it comes out. We'll even email you to let you know it's ready.
Cheers!
I just purchased the
Starting in Symfony2: Episode 1 (2.2) Tutorial
and is not working the download and the watch option, so i can not see wath i just bought!! how can i see the video????
Hi @iair linker
All the links are working again now! We deployed a big release to the site on Fri and some of the videos were temporarily unavailable. But all should be well - sorry about any inconvenience and please let me know if oyu have any other issues!
Cheers!
Had the same problem. Removing this code also worked for me, but is this the only way to fix this?
Hi guys!
I'm not sure why this bit of code would be affecting the stylesheets, but I've just pushed a small update that will hopefully clarify where the code should go and its purpose: https://github.com/knpunive...
Since this code just prints out some things, it *shouldn't* affect stylesheets. But let me know if you're having issues, we'll find out why, and update things to make sure nobody else has the same problem.
Thanks!
I think it's the cache. I didn't remove that part of the code, instead I just modified the index.html.twig file and it worked. I made sure it was using the template by changing the code where it points to index.html.twig (and it gave an error saying not found because i changed it to index1.html.twig) then I just modified it (the twig file) and it just started working.
Interesting - it does make sense based on the reports, though normally the template cache isn't a problem. I've opened up an issue to check into it further: https://github.com/knpunive.... If you have any extra details you want to add, it's much appreciated.
Thanks again!
Hi,
I follow the tutorial and I think there's a small mistake in the PDF provided.
On page 13 (Twig part) the first part called "Template name and path examples" you propose EventController instead of EventBundle, I think.
Hi Mathias Strasser!
Yes, you're absolutely right! I've fixed it here: https://github.com/knpunive...
Thanks so much for letting us know!
Hi again,
In your chapter "Fixtures and External Libraries", apparently, now this command:
php composer.phar update doctrine-fixtures-bundle
We have this message:
Package "doctrine-fixtures-bundle" listed for update is not installed. Ignoring.
We need to write the complete name of package:
php composer.phar update doctrine/doctrine-fixtures-bundle
Hi Mathias Strasser!
Thanks again! At one point, the composer update syntax was "fuzzy" - meaning you could say "doctrine" and it would update all libraries that had "doctrine" in their names. However, it was never documented, so it may have been a feature that was on accident :). I've opened up and already fixed the issue - you can see it at https://github.com/knpunive....
Thanks so much again for the report! If you find more, you can comment here or open an issue on GitHub.
Thanks!
Ryan, the comment in the code sample under routing should say # app/config/routing.yml not # app/config/config.yml
Hey Scott!
You're absolutely right - thanks for the tip! I've fixed it and pushed the update.
Thanks!
I would consider purchasing this, but I feel the screencasts on installation / configuration (readily available *everywhere*) are not sufficient for me to decide that the rest of the course is worthwhile. I would have, at least, wanted the next one included in the trial.
Hi J7mbo!
That makes sense :). To get some more details, you can also go to the other chapters in the course and read-through the scripts, which are available right on the page. Hopefully that will give you a better idea of what the things we're going through for the rest of the course :).
Cheers!
Sounds good - when is the next 2.2 course being released? Trying to gauge how long I'll have to wait for the next ones (particularly 2.3) before committing :)
We should get episodes 3 and 4 for 2.2 out in the next few weeks. It's very minor changes though - we'll just make sure code work and highlight any new changes. Fortunately, Symfony keeps backwards compatibility quite well :).
Thanks for your interest!
At 1:09:50 after deleting the event route I ran into some troubles.
When I go to /event/new Symfony is telling me that there is no route "event".
An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "event" as such route does not exist.") in EventBundle:Event:new.html.twig at line 6.
So my question is how to change this line:
< a class="link" href="{{ path('event') }}">← back to the event list< / a >
... so that I can get the desired result.
I posted the same problem ... and found a solution 5 min. after having posted ..
I just gave the annotation route in the Default-Controller a name, the lines look like this now:
/**
* Lists all Event entities.
*
* @Template()
* @Route("/", name="event")
*/
i don't know if that's the right solution, but it did the trick for me.
Now, only the edit-page is complaining about an redundant Body-Block, but that should be easy to remove.. ;)
Edit: the body-error was my mistake... had hit a key by accident...
Hi guys!
Yes, the solution by taZign is perfect! When we moved the route into annotation, we didn't give it a name by default. It was originally named `event`, which is the root key in routing.yml for that route. On line 6 of new.html.twig, we're referencing it by that name. The solution is to make sure that our new route is called `event` (which the above code accomplishes). This is definitely an error in the screencast - and the solution is to fix the route so that it's called "event" - the template itself shouldn't need to change.
We'll update this little bit for the next time we update the screencast. Thanks for the questions and solutions!
Hi guys!
I've also just updated the script on this page and the code download with the changes.
Cheers!
Thanks for the fast reaction!
The only thing i now have to find out is why the asset_url gives the wrong path to my stylesheets in prod-env.
with app_dev.php all images and styles are applied.
with app.php only naked HTML, since the path points directly to the web-directory without including the bundle-name...
probably my mistake...
Edit: And once again me :)
php app/console assetic:dump --env=prod --no-debug
... and everything is working fine in app.php :)
I should have started learning Symfony via this screencast. I'd recommend spending a couple of days going through the symfony.com book, but then jump over to this screencast series. The content and production are top notch.
Purchased this earlier today and am working through it now, it is really well done, will be buying the others, thanks very much :)
Are you planning on upgrading the videos to the current LTS symfony 2.3 release?
Hi sherif sabry!
Yes, we definitely will be updating them shortly! BUT, the good news is that nothing has really changed. Symfony has added some really nice features (which you can read more about here: http://symfony.com/blog/cat..., but for things that have changed, backwards compatibility is typically being kept until Symfony 3.0. That means that everything you're learning here is still up to date and should continue working :). When we update for each version, we verify that things are still working correctly and add any notes needed so that you're aware of any changes or new, alternative ways of doing things.
So, if you want to learn Symfony, there's no reason to wait :).
Cheers!
I created a few batch files and saved them to a gist https://gist.github.com/tvl... . This makes it easier to do the asset dump (because we can't use the alias' in windows) and update the schema and update the fixtures. These do everything for test/dev and dev/prod where required. They are very simple but I find them helpful because it's less typing when those have to be done a lot.
I found that it is easier to drop the db and then update the schema for ms sql server 2012. There are a lot of errors that get thrown when I don't drop the tables first.
Fantastic screencasts looking forward for more like for some commerce/cart , cms examples best building practices and etc . thx a lot !! :)
Btw plz move all Symfony screenasts to Symfony tag / sub page , that they all reside in /screencast/tag/symfony it would be better to navigate through them. thx
@Sargath Done! Thanks for pointing that out :)
I am not sure if anyone experienced this, but for some reason, the style sheets are not applied to my index page. Frustrating part is it is taking the default index page which has been overwritten by the new html. Yes, I deleted the cache! show, edit pages are looking good with the css.
From the free videos i have seen, these screencasts are awesome!
The only complaint i have is that it feels a little too presentation-ish and edited. Probably due to the fact that the person speaking is different from the person writing the code. So we are missing out on the pace, subtleties, side tips and segways, human errors, fixes etc.
Anyway, you guys are the only ones making comprehensive symfony screencasts so keep up the good work!