phone-number-bundle icon indicating copy to clipboard operation
phone-number-bundle copied to clipboard

Could not load type "phone_number"

Open diriy opened this issue 7 years ago • 0 comments

I use Symfony 3.2 and the latest version of EasyAdminBundle. But when I tried to add the phoneNumber field, I got the following error: "Could not load type "phone_number"" which was caused in file vendor\symfony\symfony\src\Symfony\Component\Form\FormRegistry.php line 87 I send the code from this file. How can I solve this issue?

/** * {@inheritdoc} */ public function getType($name) { if (!isset($this->types[$name])) { $type = null; foreach ($this->extensions as $extension) { if ($extension->hasType($name)) { $type = $extension->getType($name); break; } } if (!$type) { // Support fully-qualified class names if (class_exists($name) && in_array('Symfony\Component\Form\FormTypeInterface', class_implements($name))) { $type = new $name(); } else { throw new InvalidArgumentException(sprintf('Could not load type "%s"', $name)); } } $this->types[$name] = $this->resolveType($type); } return $this->types[$name]; }

diriy avatar Sep 23 '17 22:09 diriy