Question

I'm in the process of learnign symfony and now I'm playing with the admin generator.

I'm doing a blog as test project.

I've managed to list my post & my comments but I was wondering if there was any way to have the comments crud below the post view instead of having to seperate pages ?

Thanks for reading

Was it helpful?

Solution

It should be noted that the template system that is available in the "Frontend", is also available in the admin generator. If you create /template files in your admin generator modules, whatever template file that is placed there will override the generated ones.

This being said, you can create highly customized interfaces in the admin generator using this method. Just override what you need, and let the admin generator handle the rest.

More information on how to use templates in the backend here: http://www.symfony-project.org/jobeet/1_4/Doctrine/en/12#chapter_12_templates_customization

OTHER TIPS

You are going to have to do custom code for this. As soon as you start stepping away from what the admin generator gives you out of the box it is usually simpler to write your own code rather than trying to extend the admin generator code (unless it is really simple)

By using a custom form & the admin generator, you can generate some rather complicated admin pages. You can embed an entire subform for a related object, have it display the actual choices for one to many and many to many relationships, and lots more. Essentially, if you create a form, it will generate a page from it.

While you could probably figure out a way to embed a subform for each comment, I don't think that would be a good idea. Generally, you only want to embed one form within another for a one to one relation, such as a user_details form embedded in the user form.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top