Comments (13)
@fromdz27 Can you please give more informations about your issue? Can't help you with your current description.
from ivory-ordered-form.
hi again,
i had this form fields like this :
$builder ->add('titre', 'text') ->add('contenu', 'textarea') ->add('publie', 'entity', array('position' => array('after' => 'titre'))) ->add('submit','submit') ;
and i had this error
Could not load type "entity"
just when i insert 'entity' field type
from ivory-ordered-form.
What is your Symfony & PHP versions?
from ivory-ordered-form.
symfony 2.7 and php 7.0
from ivory-ordered-form.
Last thing which can help me: do you have a stacktrace of the error?
from ivory-ordered-form.
please what's
a stacktrace of the error
from ivory-ordered-form.
ok, i get it
Stack Trace
in vendor\symfony\symfony\src\Symfony\Component\Form\FormRegistry.php at line 83 -
}
if (!$type) {
throw new InvalidArgumentException(sprintf('Could not load type "%s"', $name));
}
$this->resolveAndAddType($type);
at FormRegistry ->getType ('entity')
in vendor\symfony\symfony\src\Symfony\Component\Form\FormFactory.php at line 82 +
at FormFactory ->createNamedBuilder ('contenu', 'entity', null, array())
in vendor\symfony\symfony\src\Symfony\Component\Form\FormBuilder.php at line 106 +
at FormBuilder ->create ('contenu', 'entity', array())
in vendor\symfony\symfony\src\Symfony\Component\Form\FormBuilder.php at line 269 +
at FormBuilder ->resolveChildren ()
in vendor\symfony\symfony\src\Symfony\Component\Form\FormBuilder.php at line 215 +
at FormBuilder ->getForm ()
in vendor\symfony\symfony\src\Symfony\Component\Form\FormFactory.php at line 39 +
at FormFactory ->create (object(ArticleType), object(Article))
in src\Sdz\BlogBundle\Controller\ArticleController.php at line 36 +
at ArticleController ->addAction (object(Request))
at call_user_func_array (array(object(ArticleController), 'addAction'), array(object(Request)))
in app\bootstrap.php.cache at line 3140 +
at HttpKernel ->handleRaw (object(Request), '1')
in app\bootstrap.php.cache at line 3099 +
at HttpKernel ->handle (object(Request), '1', true)
in app\bootstrap.php.cache at line 3253 +
at ContainerAwareHttpKernel ->handle (object(Request), '1', true)
in app\bootstrap.php.cache at line 2484 +
at Kernel ->handle (object(Request))
in web\app_dev.php at line 29 +
from ivory-ordered-form.
Hum... Probably obvious but if you remove the position option, everything is working? (I just want to be sure something is broken in the bundle and not in your code before investigating time into the issue)
from ivory-ordered-form.
Hi, again
I try this without error but no action it just render my form without position change
$builder ->add('categories', 'entity', array( 'class' => 'SdzBlogBundle:Categories', 'property' => 'nom', 'multiple' => true), array('position' => 'last') ) ->add('titre', 'text') ->add('contenu', 'textarea') ->add('image', new ImageType()) ->add('publie', 'checkbox') ->add('submit','submit') ;
from ivory-ordered-form.
@fromdz27 I give a try to your issue in the referenced commit (Symfony 2.7.24) and eveything is working fine, I'm not able to reproduce your issue.
Regarding your last message, your configuration is wrong, you need to use:
$builder
->add('categories', 'entity', array(
'class' => 'SdzBlogBundle:Categories',
'property' => 'nom',
'multiple' => true,
'position' => 'last'
)
->add('titre', 'text')
->add('contenu', 'textarea')
->add('image', new ImageType())
->add('publie', 'checkbox')
->add('submit','submit');
from ivory-ordered-form.
@fromdz27 Have you give a try to my example?
from ivory-ordered-form.
finally it's working. thank you for your help
just i fix
array('position' => 'last')
to
'position' => 'last'
from ivory-ordered-form.
@fromdz27 Can you please give me your exact version of PHP & Symfony (x.y.z not just x.y)? It seems strange to me than the entity type could not be loaded just due to this invalid form configuration... (the error should be more meaningful). When using 2.7.24, I can't replicate this behavior.
In all cases, closing as there is no bug in this repository and my question is much more by curiosity...
from ivory-ordered-form.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ivory-ordered-form.