WhiteOctoberAdminBundle icon indicating copy to clipboard operation
WhiteOctoberAdminBundle copied to clipboard

Modifying the form fields/possibilites

Open teo-sk opened this issue 13 years ago • 1 comments

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 avatar Oct 05 '11 19:10 teo-sk

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.

teo-sk avatar Oct 06 '11 19:10 teo-sk