Php 奏鸣曲如何显示实体的所有画面
我想在我的PageAdmin formMapper中显示我的产品实体的所有实例。我在文件里找过类似的东西,但找不到。有人知道怎么做吗 这是我的网页管理员Php 奏鸣曲如何显示实体的所有画面,php,symfony,sonata-admin,Php,Symfony,Sonata Admin,我想在我的PageAdmin formMapper中显示我的产品实体的所有实例。我在文件里找过类似的东西,但找不到。有人知道怎么做吗 这是我的网页管理员 <?php namespace MyShop\ShopBundle\Admin; use Sonata\AdminBundle\Admin\Admin; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper;
<?php
namespace MyShop\ShopBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
class PageAdmin extends Admin
{
// Fields to be shown on create/edit forms
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
// ->add('title', 'text', array('label' => 'Post Title'))
// ->add('author', 'entity', array('class' => 'MyShop\UserBundle\Entity\User'))
->add('title', 'text', array('label' => 'Page Title'))
;
}
// Fields to be shown on filter forms
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('title')
;
}
// Fields to be shown on lists
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
// ->addIdentifier('title')
->add('title')
->add('_action', 'actions', array(
'actions' => array(
'edit' => array(),
)
))
;
}
}
您可以覆盖此实体的CRUDController,尤其是listViewAction,如线程上所示: 如果需要有关CRUDController覆盖的更多信息,请参阅本页: