N
N
nepster-web2014-11-03 18:41:34
symfony
nepster-web, 2014-11-03 18:41:34

Where to start designing a project for Symfony2?

For learning purposes, I will write a small project on symfony2.
Before that, I always started designing from a database (actually, as recommended in many articles).
After working a little in symphony2, for some reason I became very unaccustomed to living in its environment after working with Yii2. Working with entities, generating getters and setters, all this is somehow unusual. I also drew attention to such a thing as the fact that the symphony first agitates to create classes, and then update the database, that is, create tables.
Is it really possible to do the opposite? First, it creates a database, tables, and then, let's say, based on the table, we generate an entity or crud, for example?
In general, how to start designing for symphony2?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Kulikovsky, 2014-11-04
@nepster-web

Usually, the beginning of development begins with the creation of bundles, if the project is not large, one AppBundle is enough, if it is large, it is better to split it up, then it will be easier to navigate + the possibility of reuse.
Next, the model (ORM) is usually described. About using the command to auto-generate getters/setters - I would not recommend using it, because. we can have "our" methods in entity. Besides, any IDE can generate getters/setters automatically.
After we create controllers + configure routing, if necessary, create repositories / managers. In parallel, we create views, everything should be clear here.
If you use phpStorm, install plugins: Symfony2-plugin (do not forget to set it up for the project and enable it), PHP Annotations and Symfony Clickable views. All this greatly simplifies development.
If you are just learning Symfony, I would advise you to go deeper into the main subsystems (everything is very flexible there, but it may seem too complicated from the start, but it seems so). We start with routing, container-dependencies, configuration, security, form (the last two are the most complex) and in order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question