Git Product home page Git Product logo

form's People

Contributors

arderyp avatar lrotherfield avatar sgilberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

form's Issues

Error loading

Hi I am getting this error.
Attempted to load class "HiddenEntityType" from namespace "Lrotherfield\Component\Form\Type".
Did you forget a "use" statement for another namespace?

Do I need to register the bundle in the App kernel?

Could not load type "Symfony\Component\Form\Extension\Core\Type\HiddenType"

In Symfony 2.7.10/2.7.9 the latest update breaks, with any form type using hidden_entity:

Could not load type "Symfony\Component\Form\Extension\Core\Type\HiddenType"

This commit here:
b9cf834

    /**
     * Set the parent form type to Symfony core HiddenType
     *
     * TODO: when drop Symfony 2.x support, add use statement above
     *       for HiddenType core class and return HiddenType::class
     *       here instead of path string
     *
     * @return string
     */
    public function getParent()
    {
        return 'hidden';
    }

I just change getParent to return 'hidden' instead of the class name and it works again. Not sure what else to do to help... but just a heads up.

Unable to set data attribute

I'm trying to give the hidden field a value, but I can't find any way to do it. Does Symfony hide this data from the html? All the examples stop at telling me to supply the class name, but don't mention how to give the form field a value. I tried the below:

$builder->add('owner_id',  'hidden_entity', array(
  "class" => "AcmeExampleBundle:Employees",
  'data'=> $this->securityContext->getToken()->getUser()
));

But the generated html has no value. When I submit the form, Symfony gives a 500 error about Object of class Acme\ExampleBundle\Entity\Employees could not be converted to string in /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 2794 (which ironically is the opposite problem I had before, trying to make a owner_id a plain hidden field.)

Any ideas? You'd think this is the second thing people would need to do, not sure why it's so difficult.

service not provided

Why forcing user to provide its own service?
Can't this bundle just provide a ready to use service?

Tag a new release

Hi,

The latest merged fix is pretty useful, would you mind tagging a new release?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.