Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7672985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:24:33+00:00 2026-05-31T16:24:33+00:00

In the process of building a third party bundle for the Symfony2 framework I

  • 0

In the process of building a third party bundle for the Symfony2 framework I have run into a problem with allowing configuration to happen in the app/config.yml file. I want to do this so users of the bundle (mostly myself) won’t have to go into the bundle to make configuration changes.

My bundle Configuration.php file reads:

<?php

namespace Ms2474\AuthNetBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\NodeBuilder;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Configuration implements ConfigurationInterface
{
    public function getConfigTreeBuilder() {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('authorize_net');
        $rootNode
            ->children()
                ->scalarNode('login_id')->defaultNull()->end()
                ->scalarNode('transaction_key')->defaultNull()->end()
                ->booleanNode('sandbox')->defaultValue(true)->end()
                ->scalarNode('log_file')->defaultValue(false)->end()
            ->end();

        return $treeBuilder;
    }
}

The bundle extension file (Ms2474AuthNetBundleExtension.php) reads:

<?php

namespace Ms2474\AuthNetBundle\DependencyInjection;

use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Definition\Processor;

class Ms2474AuthNetBundleExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->process($configuration->getConfigTree(), $configs);

        if (null === $config['sandbox']) {
            $config['sandbox'] = $container->getParameter('kernel.debug');
        }

        $container->setParameter('authorize_net.login_id', $config['login_id']);
        $container->setParameter('authorize_net.transaction_key', $config['transaction_key']);
        $container->setParameter('authorize_net.sandbox', $config['sandbox']);

        if (isset($config['log_file'])) {
            $container->setParameter('authorize_net.log_file', $config['log_file']);
        }

        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }
}

Now for the problem:

When I try to add the following to the app/config.yml file:

authorize_net:
    login_id: 1234
    transaction_key: 1234
    sandbox: true
    log_file: false

I get the following two errors:

InvalidArgumentException: There is no extension able to load the configuration for "authorize_net" (in /path/to/app/config/config.yml). Looked for namespace "authorize_net", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "jms_security_extra", "jms_aop", "fos_user", "jms_serializer", "fos_rest", "stof_doctrine_extensions", "vich_uploader", "gri_user", "gri_campaign", "gri_authorized_contact", "web_profiler", "sensio_distribution"

and:

FileLoaderLoadException: Cannot import resource "/path/to/app/config/config.yml" from "/path/to/app/config/config_dev.yml".

And the question:
What am I doing wrong here? I have looked through the documentation and also compared my code to other bundles such as the FOSUserBundle.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:24:35+00:00Added an answer on May 31, 2026 at 4:24 pm

    First, it should be called Ms2474AuthNetExtension, not Ms2474AuthNetBundleExtension.

    Second, unless you’ve set up a custom namespace for the extension and loaded it manually, the configuration options should be under ms2474_auth_net, not authorize_net.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the process of building a sports team app and have created my
I am in the process of building a Rails app that will hook into
im in the process of building a slider and i have a problem with
During the process of building software applications, you would start testing what you have
Im building a web application which is a process management app. Several different employee
I'm in the process of building an app related to healthcare IT. My company
In my DirectShow application I have a third party DLL (a 32bit DirectShow filter)
In the process of building an RPM package, I have to specify the BuildRoot
I'm currently in process of selecting a framework for building a scheduling system. It
I am in the process of building a facebook app that works through iFrame

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.