WhiteOctoberAdminBundle
WhiteOctoberAdminBundle copied to clipboard
Modifying the form fields/possibilites
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?
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.