OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions How can I extends Form Type (not replace)

This topic contains 2 replies, has 2 voices, and was last updated by  thinh2010 7 years, 7 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #36276

    thinh2010
    Participant

    Hello everybody,

    I am a new guy with Oro Platform. Now I am using orocrm_task_bundle (https://github.com/orocrm/OroCRMTaskBundle) in my ORO platform.

    I want to add more fields on that. I already create a migration to do that. And now I must display it on the create / update task form. Normally it already appear on these forms. But I want to make some changes for new fields. So that I decided extends the TaskType form (OroCRM\Bundle\TaskBundle\Controller\TaskType).

    In my form type file, I already use getParent() function to make it extends from OroCRM\Bundle\TaskBundle\Controller\TaskType, and then in BuildForm() function I add the custom form field. but the platform cannot recognize.

    Do you guys know another way to extends the current Form, just extends, I don’t want replace it.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #36277

    Stepan Yudin
    Participant

    Why dont use Symfony’s Form Extensions?
    Symfony docs: How to Create a Form Type Extension

    FormExtension class looks like that:


    Docker environment for Symfony2/OroCRM/OroBAP development on Windows platform
    https://github.com/stepansib/sf-oro-docker

    #36278

    thinh2010
    Participant

    Thanks for your reply.

    If I use Form Type Extension, everywhere call this form type will be changed, I don’t want that.
    But I found another way. I extend the TaskController and then I override update function, where call to the Task Form Type. Here I change to the name of my own extends form.

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top