FAQ Database Discussion Community


Dropzone.js and symfony formbuilder

javascript,php,symfony2,formbuilder
I'm trying to handle dropzone.js to work correct with my entity symfony formbuilder. Everything works properly if I'm using simple <input type="file" id="form_file" name="form[file]"> BUT if I'm using dropzone.js I get this difference in my POST: How I can handle it? This is my js for it: Dropzone.options.myAwesomeDropzone = {...

symfony2 form: how to save entity and how to add more then one entity to the same form?

symfony2,doctrine2,formbuilder
I have this function in a entitytype class public function buildForm(FormBuilderInterface $builder, array $options) { $builder //...other controls ->add('types', 'entity', array( 'class' => 'MyApplicationBundle:Type', 'property' => 'type', 'expanded' => false, 'multiple' => true)) ->add('save', 'submit'); } the archive entity has a type property, many to may relation /** * @ORM\ManyToMany(targetEntity="Type",...

How to build Orbeon Forms in Professional Edition mode?

build,xhtml,orbeon,xforms,formbuilder
I have downloaded Orbeon source code from the following link, https://github.com/orbeon/orbeon-forms/wiki/Contributors-~-Building-Orbeon-Forms#from-the-command-line. After downloading the distribution, I have unzip the distribution and created the build through command line. By default It is created the build for Community Edition. How do I create a build for Professional Edition? Where do I need...

Error: Call to a member function format() on a non-object with \DateTime

php,symfony2,datetime,doctrine2,formbuilder
I have one problem with my Symfony project. I have one entity with many \DateTime like this : /** * @var \DateTime * * @ORM\Column(name="date_debut", type="datetime", length=255) */ protected $dteDebut ; function getDteDebut() {return $this->dteDebut;} function setDteDebut(\DateTime $dteDebut) {$this->dteDebut = $dteDebut;} I use formBuilder with datetime like this: $builder->add('dteDebut', 'datetime',...

Can the Symfony2 form builder be used for the login form?

symfony2,login,formbuilder
I have spent the last several hours trying to get a login form built with the Symfony form builder to work. As far as I can tell, the problem is that the form builder creates field names of the form formName[fieldName] (e.g., login[_username]) and the security component looks for "flat"...

Symfony2 form builder without class check if multiple fields are empty

validation,symfony2,constraints,formbuilder
I am using form builder without class and have two fields with each having constraints : $form = $this->createFormBuilder() ->add('name', 'text', array( 'required'=>false, 'constraints'=> new Length(array('min'=>3) )) ->add('dob', 'date', array( 'required'=>false, 'constraints'=> new Date() )) ->getForm() ->handleRequest($request); This works great but I want to check if both fields are emtpy,...

symfony 2.6 buildForm versus createFormBuilder

symfony2,formbuilder
someone can explain me the difference between buildForm and CreateFormBuilder? what is the best way to create forms? I'm reading symblog and it uses: use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; class EnquiryType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('name'); $builder->add('email', 'email'); $builder->add('subject'); $builder->add('body', 'textarea'); but in documentation symfony...

Symfony form not saving entity with ManyToMany relation

php,symfony2,formbuilder
I have problem saving entity trough form with ManyToMany relations. I can not save fields that are on "mappedBy" side of relation. Code below is not saving anything to database and not trowing any errors: // Entity/Pet /** * @var \Doctrine\Common\Collections\Collection * * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Customer", mappedBy="pet", cascade={"persist"}) */ private $customer; /**...

Updating multiple columns in a joins table in Rails 4

ruby-on-rails,ruby-on-rails-4,activerecord,formbuilder
I'm having a bit of trouble getting my code to work - I have several models - Student, Course, and CourseStudents, a joins table between the two. A Student can be assigned to multiple Courses through the CourseStudents model. student.rb has_many :courses, :through => :course_students course.rb has_many :students, :through =>...

Laravel 4 form builder creating 'list' attribute input

php,laravel,formbuilder
I'm trying to use the form builder to create the following line of code: <input type="text" list="book_type" id="b_type" name="book_type"> However, I have no idea how do create the list type. And this won't work: {{ Form::input('list', 'book_type' }} ...

Can it possible to Subforms for a form in the Orbeon Form Builder?

orbeon,formbuilder
I've created a simple forms in Form Builder. But now I need a create a form which may need a kind of subform in it. Let me explain my scenario first. I have a form (Users) where I can fill all the user information. Now I want to add the...

Symfony/Twig radio style formbuilder

php,symfony2,twig,formbuilder
I need to style each of radio button using Symfony form builder. This is my part of my createFormBuilder: ->add('categoryId', 'entity', array( 'class' => 'MyBundle:Category', 'property' => 'name', 'required' => false, 'expanded' => true )) And in my twig template: {% for child in form.categoryId %} <div class="radio i-checks col-md-3">...

f.input rows not working Rails 4

ruby-on-rails,ruby-on-rails-4,rows,simple-form,formbuilder
Using simple form and f.input on my rails 4 app, however, the row amount is not working. Displays 1 row only. <%= simple_form_for(@article) do |f| %> <%= f.error_notification %> <%= f.input :whyrating, :input_html => { :rows => 5 } %> <% end %> also tried without input_html <%= f.input :whyrating,...