Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6075793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:32:03+00:00 2026-05-23T10:32:03+00:00

So, im trying to embed one form in another without creating a class for

  • 0

So, im trying to embed one form in another without creating a class for the forms. Heres what ive got

    $form = $this
        ->buildForm('UserAlert', $alert)
        ->add('Alert', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Alert', 'property' => 'name', 'required' => true))
        ->add('Site', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Site', 'property' => 'name', 'required' => false))
        ->add('Keyword', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Keyword', 'property' => 'name', 'required' => false))
        ->add('Variant', 'entity', array('class' => 'Blah\MgmtBundle\Entity\Variant', 'property' => 'name', 'required' => false))
        ->add('Name', 'text');


    $uac = $alert->getUserAlertConfig();
    $subform = $this
        ->buildForm('UserAlertConfig', $uac)
        ->add('EmailAlert', 'choice', array('choices' => array('1' => 'Yes', '0' => 'No'), 'required' => true, 'label' => 'Email Alerts'))
        ->add('EmailHours', 'text', array('required' => false, 'label' => 'Email Alert Hours'))
        ->add('TextAlert', 'choice', array('choices' => array('1' => 'Yes', '0' => 'No'), 'required' => true, 'label' => 'Text Alerts'))
        ->add('TextHours', 'text', array('required' => false, 'label' => 'Text Alert Hours'));

    $form->add($subform);
    $form = $form->getForm();

however, on the getForm() function, its saying

Neither property "form" nor method "getForm()" nor method "isForm()" exists in class "Blah\MgmtBundle\Entity\UserAlert"

anyone have any idea how im supposed to get this to work using the quickloading stuff?

heres buildForm

public function buildForm($model = '', $data)
{
    if (empty($model)) {
        throw new \Exception("Must define a model");
    }
    return $this->get('form.factory')->createBuilder('form', $data, array('data_class' => "\\Blah\\MgmtBundle\\Entity\\$model"));
}


    Stack Trace
in /mnt/www/reporting/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php at line 314    
at PropertyPath ->readProperty (object(UserAlert), '0') 
in /mnt/www/reporting/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php at line 191    
at PropertyPath ->getValue (object(UserAlert)) 
in /mnt/www/reporting/vendor/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php at line 64   
at PropertyPathMapper ->mapDataToForm (object(UserAlert), object(Form)) 
in /mnt/www/reporting/vendor/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php at line 55   
at PropertyPathMapper ->mapDataToForms (object(UserAlert), array('_token' => object(Form), 'Alert' => object(Form), 'Site' => object(Form), 'Keyword' => object(Form), 'Variant' => object(Form), 'Name' => object(Form), 'form' => object(Form))) 
in /mnt/www/reporting/vendor/symfony/src/Symfony/Component/Form/Form.php at line 404    
at Form ->setData (object(UserAlert)) 
in /mnt/www/reporting/vendor/symfony/src/Symfony/Component/Form/FormBuilder.php at line 659    
at FormBuilder ->getForm () 
in /mnt/www/reporting/src/Blah/MgmtBundle/Controller/AlertController.php at line 96    
at AlertController ->editAction ('1') 
in at line     
at call_user_func_array (array(object(AlertController), 'editAction'), array('1')) 
in kernel.root_dir/bootstrap.php.cache at line 438    
at HttpKernel ->handleRaw (object(Request), '1') 
in kernel.root_dir/bootstrap.php.cache at line 416    
at HttpKernel ->handle (object(Request), '1', true) 
in /mnt/www/reporting/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php at line 44    
at HttpKernel ->handle (object(Request), '1', true) 
in kernel.root_dir/bootstrap.php.cache at line 612    
at Kernel ->handle (object(Request)) 
in /mnt/www/reporting/web/app_dev.php at line 12    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:32:04+00:00Added an answer on May 23, 2026 at 10:32 am

    Ended up creating an interface for the subform and adding it like this

        $form = $this
            ->buildForm('UserAlert', $alert)
            ->add('Alert', 'entity', array('class' => 'Neokeo\MgmtBundle\Entity\Alert', 'property' => 'name', 'required' => true))
            ->add('Site', 'entity', array('class' => 'Neokeo\MgmtBundle\Entity\Site', 'property' => 'name', 'required' => false))
            ->add('Keyword', 'entity', array('class' => 'Neokeo\MgmtBundle\Entity\Keyword', 'property' => 'name', 'required' => false))
            ->add('Variant', 'entity', array('class' => 'Neokeo\MgmtBundle\Entity\Variant', 'property' => 'name', 'required' => false))
            ->add('Name', 'text');
    
        $uac = $alert->getUserAlertConfig();
    
    
    
        $subform = $this->buildForm('UserAlertConfig', $uac, new \Neokeo\MgmtBundle\Form\UserAlertConfig)
            ->add('EmailAlert', 'choice', array('choices' => array('0' => 'No', '1' => 'Yes'), 'required' => true, 'label' => 'Email Alerts'))
            ->add('TextAlert', 'choice', array('choices' => array('0' => 'No', '1' => 'Yes'), 'required' => true, 'label' => 'Text Alerts'));
    
        $form->add($subform, '', array('label' => ''));
        $form = $form->getForm();
    

    if anyone can find an easier way without creating interfaces, let me know

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to embed one DIV inside another without it inheriting the opacity style
I am trying to embed multiple external websites into one web page. Using an
I'm trying to embed a Unity3D-ActiveX control into a WPF-Form by using a WinFormsHost-Control.
I have a user control with a form, and I am trying to embed
I'm trying to write a simple component that will allow you to embed one
I'm trying to embed a Haskell REPL within one of my Haskell applications. The
I'm trying to test the PHPmailer class to embed image (http://www.google.gr/intl/en_com/images/srpr/logo1w.png) inside an e-mail
I'm trying to embed multiple .less files like this <head> <link href=mine.less media=screen rel=stylesheet/less
I am trying to create a page that contains a form with one field
I am so close to having this work, I am trying to directly embed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.