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

  • Home
  • SEARCH
  • 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 9165799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:59:28+00:00 2026-06-17T14:59:28+00:00

Good evening! I have a little problem accessing custom classes in symfony2.1.6 using the

  • 0

Good evening!

I have a little problem accessing custom classes in symfony2.1.6 using the
autoloader.
What I need to do is access the
Mangress/src/Qkprod/Classes/api/APIEntry.php class from within the
DefaultController. Apparently I am too stupid to find a way to extend
the autoload.php to do that. Now I am at a point where I have been
reading so many blogposts and solutions that I don’t know anymore
what to do anymore…

My file structure looks as follows:

Mangress
 -app
 -src
    -Qkprod
      -MangressBundle
      -Controller, Entity, Resources, Tests
      -Classes
         -api
            -APIEntry.php
         -db
         -security
    -QkprodMangressBundle.php
 -vendor
 -web
 

The Classes folder contains all the classes I have written so far.

What I have read so far was that I need to register the Namespaces of
the classes to load in the Mangress/app/autoload.php
Autoloading a class in Symfony 2.1

$loader->add(‘Qkprod\MangressBundle\api’,
DIR.’/../src/Qkprod/MangressBundle/Classes/api/’);
Though this seems to be wrong..

Is there something wrong with my naming or understanding of symfony?
I register the Namespace “Qkprod\MangressBundle\api” to the autoloader
so that symfony knows where to look when

use Qkprod\MangressBundle\api\APIEntry;

So it has to look in my Mangress/src/Qkprod/MangressBundle/Classes/api
folder am I wrong?

I would really appreciate some guidance 🙂

  • 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-06-17T14:59:29+00:00Added an answer on June 17, 2026 at 2:59 pm

    Why aren’t you using the directory structure recommended by symfony developers?

    And not even just symfony developers, this structure is called PSR-0, and is adopted by many PHP frameworks.

    If you stay with the conventions, the default autoloader will load your classes just fine, and other developers will understand your code more easier.

    Just remove your “Classes” directory, and move everything from it a level upwards:

    Mangress
     -app
     -src
        -Qkprod
          -MangressBundle
            -Controller, Entity, Resources, Tests
            -Api
              -APIEntry.php
            -Db
             -security
            -QkprodMangressBundle.php
     -vendor
     -web
    

    This way when you write

    use Qkprod\MangressBundle\Api\APIEntry
    

    It will know where to look.

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

Sidebar

Related Questions

Good evening. I have a problem. i am using has_secure_password and cause of this
Good evening ladies and gentlemen, I have a problem with Java Swing that I
Good Evening, i have a problem in running a progress bar, please check my
Good evening! I'm pretty new to Linux and Apache and I have a problem
I need to greet a user (using Good morning, Good afternoon, or Good evening)
Good evening stackoverflow. I have a problem involving JOptionPanes. Every so often they simply
Good evening everyone. I am currently using MVC 3 and I have a viewmodel
Good evening fellow overflowers, I've got a little problem that I'm attempting to solve
Good evening/morning/after/noon. I have an ASP.net 3.5 website and I am using vb.net in
Good Evening, The problem is that i have both xcode 3.2 and xcode 4

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.