lrotherfield / form Goto Github PK
View Code? Open in Web Editor NEWSymfony2 Form Component additions
Symfony2 Form Component additions
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?
1.1.2 is not available on https://packagist.org/packages/lrotherfield/form I am guessing the hook is either not setup or has become disconnected. Can you update this so that new tags trigger updates over on packagist and we can use composer to get the latest version.
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.
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.
Why forcing user to provide its own service?
Can't this bundle just provide a ready to use service?
Hi,
The latest merged fix is pretty useful, would you mind tagging a new release?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.