Symfony2 backend?

I'm new to symfony, please don't scold me about this.

I read in Symfony 1.4 that there is a function to add backends to your applications through the doctrine of: generate-admin or generate: an application backend by implementing CRUD operations.

Now I wonder if there is something similar to Symfony2.0?

Basically, I have user management and a database in the background that I would like to have for my admin users, but I have to code it myself (for example, securing / admin, creating templates, classes, methods, etc. ). that perform these tasks) or can you make it easier using some existing backend functionality?

Thanks!

EDIT: Also read the plugin called "Apostophe" - but is there anything included in SF2, or are there any pre-configured versions of SF2 that already come with Backend solutions?

+4
source share
4 answers

There is a SonataAdminBundle (and maybe I haven’t seen a few more), which helps to create an administrative system, however this area still works very well for the Symfony2 community.

Lucas put together a blog post on the current development status of Symfony2 CMF with some approximate timelines - Symfony2 CMF Status

Hope this helps!

+9
source

There is also another package for admin management. You can look here http://knpbundles.com/cedriclombardot/AdmingeneratorGeneratorBundle

+2
source

For "admin generation", Symfony2 has not yet generated code in this aspect. The base is VERY STRONG. Remember that Symfony2 is still at stage 2.0. (Not 2.1 ++, like symfony1).

If you want to cut and paste the code. Symfony2 is not suitable for this.

RENOUNCEMENT

I specialize in the interface rather than the backend, but I have everything around. But thanks to Symfony2. I can be on both sides. Therefore, I speak from this context.

WARNINGS

What I call "good stuff."

  • Only using ONE {{ form_widget(form) }} does the Symfony Form Documentation recommend ... and not explicitly cut and paste from the Twig tutorial , which / implies / shows how the do theme ... does not implement, as shown in the figure.
  • The most subtle control methods are possible.
  • ... outside the scope of this message.

SO

My best advice is serious RTFM, several times, with Symfony books. This is scary, but I have been working with him since three months and re-read a lot. Every time I care about a gem.

ANSWER TO QUESTION

My current package selection:

  • FR3DLdapBundle , with FOSUserBundle
  • MopaBootstrapBundle along with all the code created using the HTML / CSS structure. Twitter Bootstrap gives. (if you have not heard about it yet, where have you been?)
  • AsseticBundle with the correct {%- javascript %} inclusion

And the rest is contextual.

My READ and RE-Read List

A hidden gem and very useful blog posts were for me:

+1
source

For completeness, there is a custom way to generate CRUD:

 php app/console doctrine:generate:crud 

This command will ask you for some information, such as an entity, if you want to perform a write operation, configuration format, or base route prefix.

In my opinion, this is the fastest and easiest way to quickly create a controller to create, read, update or delete your objects, so it is good in simple projects or encodes a basic CRUD inside a small package.

Official documentation: http://symfony.com/doc/master/bundles/SensioGeneratorBundle/commands/generate_doctrine_crud.html

0
source

Source: https://habr.com/ru/post/1380593/


All Articles