Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Modifying the form fields/possibilites #46

Open
teo-sk opened this issue Oct 5, 2011 · 1 comment
Open

Modifying the form fields/possibilites #46

teo-sk opened this issue Oct 5, 2011 · 1 comment

Comments

@teo-sk
Copy link

teo-sk commented Oct 5, 2011

Maybe a stupid question - is there an easy way to modify a few fields in the form, or easily extend the field processing?

E.g. I've got a Speaker entity and am adding these fields:

->addFields(array(
            'firstName' => array("label" => "First Name"),
            'lastName'=> array("label" => "Last Name"),
            'occupation'=> array("label" => "Occupation"),
            'description'=> array("label" => "Short Resume"),
            'picturePath'=> array("label" => "Avatar"),
            'fkCategory' => array("label" => "Category"),
        ))

And I would like to replace the picturePath text field with an upload form, and then do stuff after submitting (e.g. resize the image, store it, and just store it's path to the database.)
Is this possible?

@teo-sk
Copy link
Author

teo-sk commented Oct 6, 2011

I was able to replace the text field with upload form like this:

->addFields(array(
            'firstName' => array("label" => "First Name"),
            'lastName'=> array("label" => "Last Name"),
            'occupation'=> array("label" => "Occupation"),
            'description'=> array("label" => "Short Resume"),
            'picturePath'=> array("label" => "Avatar", "formType" => "file"),
            'fkCategory'=> array("label" => "Category"),
        ));

But I don't know where to put the code to handle the upload? Right now just the filename is stored in DB.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant