DoctrineModule \ Form \ Element \ ObjectSelect-选定的值,并在更改时自动提交

时间:2019-03-16 00:00:09

标签: php zend-framework3

我有以下选择形式的代码:

$this->add([
            'name' => 'username',
            'type' => 'DoctrineModule\Form\Element\ObjectSelect',
            'options' => [
                'object_manager' => $this->getObjectManager(),
                'target_class' => 'Application\Entity\Player',
                'property' => 'username',
                'is_method' => true,
                'empty_option' => '-- Please select Unsername --',
                'find_method' => [
                    'name' => 'getUsername',
                ],
                'label_generator' => function ($targetEntity) {
                return $targetEntity->getId() ;
            },
        ],
    ]);

我的问题是:

0 个答案:

没有答案