public function optionsForInput($input)
    {
        $options = [
            'author_name' => [
                'label' => ($this->config('anonymous_name_required') ? __d('comment', 'Name (required)') : __d('comment', 'Name'))
            ],
            'author_email' => [
                'label' => ($this->config('anonymous_email_required') ? __d('comment', 'e-Mail (required)') : __d('comment', 'e-Mail'))
            ],
            'author_web' => [
                'label' => ($this->config('anonymous_web_required') ? __d('comment', 'Website (required)') : __d('comment', 'Website'))
            ],
            'subject' => [
                'label' => __d('comment', 'Subject (required)'),
                'required',
            ],
            'body' => [
                'type' => 'textarea',
                'label' => __d('comment', 'Message (required)'),
                'required',
            ],
        ];

        if (isset($options[$input])) {
            if (in_array($input, ['author_name', 'author_email', 'author_web']) &&
                $this->config($input . '_required')
            ) {
                $options[$input]['required'] = 'required';
            }

            return $options[$input];
        }

        return [];
    }
public function optionsForInput($input)
    {
        $options = [
            'author_name' => [
                'label' => ($this->config('anonymous_name_required') ? __d('comment', 'Name (required)') : __d('comment', 'Name'))
            ],
            'author_email' => [
                'label' => ($this->config('anonymous_email_required') ? __d('comment', 'e-Mail (required)') : __d('comment', 'e-Mail'))
            ],
            'author_web' => [
                'label' => ($this->config('anonymous_web_required') ? __d('comment', 'Website (required)') : __d('comment', 'Website'))
            ],
            'subject' => [
                'label' => __d('comment', 'Subject (required)'),
                'required',
            ],
            'body' => [
                'type' => 'textarea',
                'label' => __d('comment', 'Message (required)'),
                'required',
            ],
        ];

        if (isset($options[$input])) {
            if (in_array($input, ['author_name', 'author_email', 'author_web']) &&
                $this->config($input . '_required')
            ) {
                $options[$input]['required'] = 'required';
            }

            return $options[$input];
        }

        return [];
    }
public function optionsForInput ( $ input ) { $ options = [ 'author_name' => [ 'label' => ( $ this -> config ( 'anonymous_name_required' ) ? __d ( 'comment' , 'Name (required)' ) : __d ( 'comment' , 'Name' ) ) ] , 'author_email' => [ 'label' => ( $ this -> config ( 'anonymous_email_required' ) ? __d ( 'comment' , 'e-Mail (required)' ) : __d ( 'comment' , 'e-Mail' ) ) ] , 'author_web' => [ 'label' => ( $ this -> config ( 'anonymous_web_required' ) ? __d ( 'comment' , 'Website (required)' ) : __d ( 'comment' , 'Website' ) ) ] , 'subject' => [ 'label' => __d ( 'comment' , 'Subject (required)' ) , 'required' , ] , 'body' => [ 'type' => 'textarea' , 'label' => __d ( 'comment' , 'Message (required)' ) , 'required' , ] , ] ; if ( isset ( $ options [ $ input ] ) ) { if ( in_array ( $ input , [ 'author_name' , 'author_email' , 'author_web' ] ) && $ this -> config ( $ input . '_required' ) ) { $ options [ $ input ] [ 'required' ] = 'required' ; } return $ options [ $ input ] ; } return [ ] ; }
Shortcut for generate form-input's options.

It take cares of adding an asterisk "*" to each required filed label, it also
adds the "required" attribute.

@param string $input Input name (author_name, author_email, author_web, subject or body)
@return array
Shortcut for generate form - input s options .