Symfony Live London 2013

Creando tu primera aplicación Symfony2

Stefan Koopmanschap  · 

Presentación

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

welcome everyone good morning to this talk about building your first symphony to application now the obvious first question I will have for you is how many of you actually have worked with symphony before how many of you have worked with symphony to before

okay how many of you have worked with symphony one leaf or that's all the same people okay I'm not sure what you guys are going to want to get out of this talk because it will be very basic but we'll see we'll see maybe you can have some really

hard questions for me if you want to ask questions just interrupt me don't save them up until the end because that probably means you either forget about it or I will forget about what you are referring to most important I just edit this slide because

I think Wes didn't mention it is the Wi-Fi password the password is event it's a very secure password and I think it's like glaciers whole wife I'd is the network name so then now you now that you're connected to the internet we can start

um let me first introduce myself I don't I don't recognize a lot of faces in this room so I'm guessing you guys might not know who i am i'm stefan como stop i'm from the netherlands i have been a PHP developer since somewhere 97 98 i don't

remember exactly when I just know it was PHP three that was out back then which is quite horrible if you compare it to what we have right now with PHP I've been a symphony developer somewhere since 06 or 07 I don't simply one that I wasn't out

yet I can remember that one I was working for a company building this software as a service application and we decided to migrate from joomla to symphony which was the best choice ever I sort of a community addict I've been involved in starting Peach Pit

benelux and I've been involved in starting pitch p Armas fort which is a local user group and up until last week I was part of the P of Z dot and L crew organizing PF Congress which is a conference in Utrecht in the Netherlands I run my own company called

in typical and together with a friend of mine i run a training company called academy both are in the netherlands although we work for clients worldwide so if you're interested in symfony development consulting training whatever just let me know now first

things first I when I submitted to Symphony life I submitted this talk actually as a tutorial for the tutorial day yesterday somehow it got accepted as a talk so the description on on the website actually implies that we're all going to be developing today

which seems we only have 15 minutes is not going to happen but if you're interested in the full tutorial in two weeks time in Manchester there's PHP northwest and I will be doing this as a tutorial over there so there you can actually go and sit down

with your laptop and we're going to actually hack your first application together the conference is sold out but I think they're still tutorial tickets left so if you're still interested in that just go to I think it's conferenced of PHP MW

org dot u K so what I will be talking about today is basically six steps to creating the first very basic symfony2 application it will be very basic because well I only have 50 minutes but at least I will try to get you introduced into most of the basic aspects

that you will need to build your own symfony2 application the first step is choosing your framework now for this talk obviously we've already made that choice but i still will talk about this then you'll create your project you'll be creating first

hello world then I will talking about connecting to a database I will be talking about twig a bit and then I'll be talking about forms a bit these are the basics to get the you're just a basic application up and running once you're done with this

you know how to basically build an application and how to extend it if I have some time left i'll actually show you the demo application that I've built for these slides as well we'll have to see how much time we have left so step one choosing

your framework obviously for this talk we've already chosen symphony but I think it's important to realize symphony is not the frame the only framework out there and simply might not be the right choice for every project you do I I did a project last

year in for a big client in the Netherlands where most of the stuff that needs needed to be done was basically chrome jobs that would run every minute which is not web based at all so instead of using the full symphony I I picked the selects framework CI L

X which is a command-line framework based on Symphony components but it only gives you a subset of the whole of symphony which make more sense because I don't need all of that if I just will use this small part so you you should be able to look at the

project and see what it requires and then decide whether you want to use symphony or zend framework or cylex or cilix or whatever other framework that's out there there's a couple of frameworks that you shouldn't choose but okay I'm not going

there um choice here obviously was made we're going to build this application with symphony too so the next step is creating your project there's a couple of ways of getting the basic symphony to code base the first one was obviously just downloading

as if our tar file from the website you go to Symphony dadgum / download you download the zip file you extracted and and then you've got basically you've got your project setup you can do that I would not recommend it I would actually recommend using

composer now composer is a dependency management too so basically what composer does is it looks at your libraries that you're going to use and then looks at the dependencies that those libraries have and it will install those as well so you don't

have to worry about getting all the libraries together because composer will handle that and it has some really cool features like you can create a project based on a certain library in this case i'm using the frame using the framework standard edition

of symphony now this is a prebuilt distribution of symphony with all of the common stuff in there so it already has some other stuff not just symphony but some other bundles in there that that you will probably need when you build your application on top of

symphony so what I do here is I say okay so composer that far which is the executable for composer create project based on symphony framework standard edition then my project is the directory that I'm installing this into and I'm using version 2.3

point for for this project when I do that composer will automatically start downloading all of the components that it needs all of the libraries that it needs and then it will also give me basic configuration questions so right now I just I didn't really

answer any of the questions I just used the default values at some point we will change that so that I can actually show you where the configuration is located but it's it's actually it's an interactive process so composer will actually help you

set up the project which is really nice you won't have to manually do everything and you will notice later on as well that symphony has a lot of stuff like this where it will it will actively ask you questions and then generate some code for you so you

don't have to do it all manually because that would take more time and you would probably make some mistakes at some point and you have to figure it out why why it's not working so then once you filled out all the questions it will clear the cache

for you it will install all the assets and stuff like that and you're done it's one thing is that the logs and the cache directory should be writable obviously otherwise you would get errors immediately now once I've done that I've already

got it set up it's working there's something in the browser when I go to this URL obviously I haven't really set up a patchy to have to have its own virtual host i'm just going to it directly right now i could set it up i'm not going to

go into setting up apache because we're talking about symphony today so this is the default page when you go to into the development environment of your application and it will give you a lot of information links to the documentation you can there's

[ ... ]

Nota: se han omitido las otras 4.135 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.