Skip to content

Form generation #15

Open
Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
I haven't followed the the project lately, but it would be great to include ZF 
form generation as well which can save precious programming time.

Please find attachement of my form template. I'm using this in my projects and 
works great.

In order it to work you will need to define form_type value (a conversion from 
php_value) in the generator class. This should look like something like this:

    private function _convertTypeToForm($str) {
        if (in_array($str, array('text'))) {
            $res = 'textarea';
        } elseif (in_array($str, array('boolean', 'bool'))) {
            $res = 'checkbox';
        } else {
            $res = 'text';
        }

        return $res;
    }

 $columns[] = array(
                        'field' => $field,
                        'type' => $type,
                        'phptype' => $this->_convertPgsqlTypeToPhp($type),
                        'formtype' => (substr($field, -3) == '_id' ? 'select' : $this->_convertTypeToForm($type)),
                        'is_required' => $notNull,
                        'is_primary' => $isPrimary,
                        'capital' => $this->_getCapital($field)
                    );

Original issue reported on code.google.com by [email protected] on 27 Oct 2011 at 7:15

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions