When building a simple site with Silex and Symfony components, I receive the following error after installing the FormServiceProvider service:
ClassNotFoundException in XliffFileLoader.php line 54:
Attempted to load class "XmlUtils" from namespace "Symfony\Component\Config\Util". Did you forget a "use" statement for another namespace?
The template is here:
{% extends 'base.html.twig' %}
{% block body %}
<h1>{{ page.title }}</h1>
<p>By {{ page.author }}, published on {{ page.publishedAt|date('m/d/Y') }}</p>
<pre>{{ page.content }}</pre>
<hr/>
{{ form_start(form) }}
{{ form_body(form) }}
{{ form_end(form) }}
{% endblock %}
I followed the install directions here:
https://silex.sensiolabs.org/doc/2.0/providers/form.html
I've read a number of other questions, most of which talk about a missing global namespace identifier (\DomDocument instead of DomDocument, which inherits the local namespace), or that php-xml is not installed, or that there's a missing configuration. Those are not the issues here, but here is one that covers two of those three:
Symfony app_dev.php install \DOMDomain error
And here are the configuration calls:
$this->app->register(new ServiceControllerServiceProvider());
$this->app->register(new LocaleServiceProvider());
$this->app->register(new TranslationServiceProvider(), [
'locale_fallbacks' => ['en'],
'translator.messages' => [],
'translator.domains' => [],
]);
$this->app->register(new AssetServiceProvider());
$this->app->register(new TwigServiceProvider(), [
'twig.path' => self::TEMPLATE_DIR
]);
$this->app->register(new FormServiceProvider());
$this->app->register(new MonologServiceProvider());
$this->app->register(new HttpFragmentServiceProvider());
The last two were the ones suggested as being the culprit based on configuration errors.
How is this error resolved in this situation?