1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- {% set code %}
- {%- for field in fields %}
- ->add('{{ field }}')
- {%- endfor %}
- {% endset %}
- namespace {{ namespace }};
- use Sonata\AdminBundle\Admin\AbstractAdmin;
- use Sonata\AdminBundle\Datagrid\DatagridMapper;
- use Sonata\AdminBundle\Datagrid\ListMapper;
- use Sonata\AdminBundle\Form\FormMapper;
- use Sonata\AdminBundle\Show\ShowMapper;
- class {{ classBasename }} extends AbstractAdmin
- {
- /**
- * @param DatagridMapper $datagridMapper
- */
- protected function configureDatagridFilters(DatagridMapper $datagridMapper)
- {
- $datagridMapper
- {{- code }}
- ;
- }
- /**
- * @param ListMapper $listMapper
- */
- protected function configureListFields(ListMapper $listMapper)
- {
- $listMapper
- {{- code }}
- ->add('_action', null, array(
- 'actions' => array(
- 'show' => array(),
- 'edit' => array(),
- 'delete' => array(),
- ),
- ))
- ;
- }
- /**
- * @param FormMapper $formMapper
- */
- protected function configureFormFields(FormMapper $formMapper)
- {
- $formMapper
- {{- code }}
- ;
- }
- /**
- * @param ShowMapper $showMapper
- */
- protected function configureShowFields(ShowMapper $showMapper)
- {
- $showMapper
- {{- code }}
- ;
- }
- }
|