If you're looking for a speedy implementation of an admin panel, SonataAdminBundle is worth a look.
You install via composer & import some routes, and from there, it's a matter of defining admin services, and classes that reference your Products, News and Article entities.
I like it because it's extensible & very quick to get set up. It can also handle relationships between entities by embedding one admin interface in another right out of the box, in addition to filter forms, and enabling / disabling routes on a per-entity basis. Also, the twig templates are super-modular, and can be overridden easily.
As a quick example (which assumes ORM), once you've installed SonataAdmin, add in a service definition: (ex. taken from Sonata Admin Docs)
services:
sonata.admin.pprodut:
class: Acme\DemoBundle\Admin\ProductAdmin
tags:
- { name: sonata.admin, manager_type: orm, group: "Content", label: "Product" }
arguments:
- ~
- Acme\DemoBundle\Entity\Product
- ~
... and a ProductAdmin class to match.
<?php
// src/Acme/DemoBundle/Admin/ProductAdmin.php
namespace Acme\DemoBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
class ProductAdmin extends Admin
{
// Fields to be shown on create/edit forms
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('title', 'text', array('label' => 'Product Title'))
->add('sku', 'text')
->add('description') //if no type is specified, SonataAdminBundle tries to guess it
// Other fields ...
;
}
// Fields to be shown on filter forms
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('title')
->add('sku')
;
}
// Fields to be shown on lists
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('title')
->add('sku')
;
}
}
And you're off to the races.
However, if this is an exercise for you, rather than a possible reinvention of the wheel, SonataAdmin can still serve as a nice reference bundle. :)