php - ERROR 4 Start tag expected, '<' not found (in n/a - line 1, column 1) -
php - ERROR 4 Start tag expected, '<' not found (in n/a - line 1, column 1) -
i'm getting error when add together new service:
[error 4] start tag expected, '<' not found (in n/a - line 1, column 1)
this new services.yml
file:
parameters: acme_foo.class: acme\foobundle\services\foos services: acme_foo: class: %acme_foo.class% arguments: [@doctrine]
there no tabs in file, spaces. dependencyinjection/configuration.php
file:
<?php namespace acme\foobundle\dependencyinjection; utilize symfony\component\config\definition\builder\treebuilder; utilize symfony\component\config\definition\configurationinterface; /** * class validates , merges configuration app/config files * * larn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class configuration implements configurationinterface { /** * {@inheritdoc} */ public function getconfigtreebuilder() { $treebuilder = new treebuilder(); $rootnode = $treebuilder->root('acme_foo'); // here should define parameters allowed // configure bundle. see documentation linked above // more info on topic. homecoming $treebuilder; } }
and dependencyinjection/acmefooextension.php
:
<?php namespace acme\foobundle\dependencyinjection; utilize symfony\component\dependencyinjection\containerbuilder; utilize symfony\component\config\filelocator; utilize symfony\component\httpkernel\dependencyinjection\extension; utilize symfony\component\dependencyinjection\loader; /** * class loads , manages bundle configuration * * larn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html} */ class redconvivesubscriptionextension extends extension { /** * {@inheritdoc} */ public function load(array $configs, containerbuilder $container) { $configuration = new configuration(); $config = $this->processconfiguration($configuration, $configs); $loader = new loader\xmlfileloader($container, new filelocator(__dir__.'/../resources/config')); $loader->load('services.yml'); } }
any thought of error is? seems related services.yml
, i've checked , doesn't seem there.
change
$loader = new loader\xmlfileloader
to
$loader = new loader\yamlfileloader
in dependencyinjection/acmefooextension.php
. because loading yml
file.
php symfony2 service
Comments
Post a Comment