ZfcUser\Form\Register では、__construct() メソッドで次のイベント呼び出しがあることに注意してください。
$this->getEventManager()->trigger('init', $this);
したがって、Register フォームを拡張して、first_name/last_name 要素を次のように追加できます。
class MyForm extends ZfcUser\Form\Register {
public function init(){
$this->add(array(
'name' => 'first_name',
'options' => array(
'label' => 'First Name',
),
'attributes' => array(
'type' => 'text'
),
));
$this->add(array(
'name' => 'last_name',
'options' => array(
'label' => 'Last Name',
),
'attributes' => array(
'type' => 'text'
),
));
}
}
次に、フォームを Module.php のサービスとして追加できます
public function getServiceConfig()
{
return array(
'factories' => array(
'myform' => function ($sm) {
$form = new MyForm(null, $options);
return $form;
},
),
);
}
最後に、あなたが言ったように、first_name/last_name 入力要素をビューに出力する必要もあります。