public function optionForm()
    {
        $fields = [];
        $default = $this->defaultInstallOptions();

        $fields[] = (new BooleanField('site', 'Setup Drupal site options?'))
            ->setDefault(false)
            ->setSubform(function ($subform, $value) use ($default) {
                if ($value === true) {
                    $subform->addFields([
                        (new TextField('name', 'Drupal site name?'))
                            ->setDefault($default['site']['name']),
                        (new TextField('profile', 'Drupal site profile?'))
                            ->setDefault($default['site']['profile']),
                    ]);
                }
            });

        $fields[] = (new BooleanField('account', 'Setup Drupal account options?'))
            ->setDefault(false)
            ->setSubform(function ($subform, $value) use ($default) {
                if ($value === true) {
                    $subform->addFields([
                        (new TextField('mail', 'Account email:'))
                            ->setDefault($default['account']['mail']),
                        (new TextField('name', 'Account username:'))
                            ->setDefault($default['account']['name']),
                        (new TextField('pass', 'Account password:'))
                            ->setHidden(true)
                            ->setDefault($default['account']['pass']),
                    ]);
                }
            });

        return (new Form())
            ->addFields($fields);
    }
public function optionForm()
    {
        $fields = [];
        $default = $this->defaultInstallOptions();

        $fields[] = (new BooleanField('site', 'Setup Drupal site options?'))
            ->setDefault(false)
            ->setSubform(function ($subform, $value) use ($default) {
                if ($value === true) {
                    $subform->addFields([
                        (new TextField('name', 'Drupal site name?'))
                            ->setDefault($default['site']['name']),
                        (new TextField('profile', 'Drupal site profile?'))
                            ->setDefault($default['site']['profile']),
                    ]);
                }
            });

        $fields[] = (new BooleanField('account', 'Setup Drupal account options?'))
            ->setDefault(false)
            ->setSubform(function ($subform, $value) use ($default) {
                if ($value === true) {
                    $subform->addFields([
                        (new TextField('mail', 'Account email:'))
                            ->setDefault($default['account']['mail']),
                        (new TextField('name', 'Account username:'))
                            ->setDefault($default['account']['name']),
                        (new TextField('pass', 'Account password:'))
                            ->setHidden(true)
                            ->setDefault($default['account']['pass']),
                    ]);
                }
            });

        return (new Form())
            ->addFields($fields);
    }
public function optionForm ( ) { $ fields = [ ] ; $ default = $ this -> defaultInstallOptions ( ) ; $ fields [ ] = ( new BooleanField ( 'site' , 'Setup Drupal site options?' ) ) -> setDefault ( false ) -> setSubform ( function ( $ subform , $ value ) use ( $ default ) { if ( $ value === true ) { $ subform -> addFields ( [ ( new TextField ( 'name' , 'Drupal site name?' ) ) -> setDefault ( $ default [ 'site' ] [ 'name' ] ) , ( new TextField ( 'profile' , 'Drupal site profile?' ) ) -> setDefault ( $ default [ 'site' ] [ 'profile' ] ) , ] ) ; } } ) ; $ fields [ ] = ( new BooleanField ( 'account' , 'Setup Drupal account options?' ) ) -> setDefault ( false ) -> setSubform ( function ( $ subform , $ value ) use ( $ default ) { if ( $ value === true ) { $ subform -> addFields ( [ ( new TextField ( 'mail' , 'Account email:' ) ) -> setDefault ( $ default [ 'account' ] [ 'mail' ] ) , ( new TextField ( 'name' , 'Account username:' ) ) -> setDefault ( $ default [ 'account' ] [ 'name' ] ) , ( new TextField ( 'pass' , 'Account password:' ) ) -> setHidden ( true ) -> setDefault ( $ default [ 'account' ] [ 'pass' ] ) , ] ) ; } } ) ; return ( new Form ( ) ) -> addFields ( $ fields ) ; }
Drupal option form object.

@return \Droath\ConsoleForm\Form
Drupal option form object .