0

I am using modules and here's the structure:

-application
    -modules
        -affaire
            -controllers
                -ProfileController.php
            -models
                -Affaire.php
                -AffaireMapper.php

The problem is in the index action of ProfileController, when I call :

$affaireMapper = new Affaire_Model_AffaireMapper();

The error I get is Affaire_Model_AffaireMapper not found on ... well you know the drill :P I suspect that this is because of my module name being written in lowercases. I also double checked my class name in AffaireMapper.php to be sure it wasn't mistyped. The name is Affaire_Model_AffaireMapper btw!

If it is because of what I suspect, is there any way that I can keep my lowercase name "affaire"? I want it in lowercases so my ur; are like : "somthing.com/affaire/profile". Anyway, I'm new to Zend so it might (or it IS :P) a newbie mistake!

maniak
  • 442
  • 5
  • 22
  • Possibly whichever file is including models/AffaireMapper.php is not using an absolute path and does not have the right include paths – andrewtweber Jun 29 '12 at 23:21
  • It is being included in ProfileController – maniak Jun 29 '12 at 23:22
  • Can you put that line of code in your question? Also `var_dump(get_include_path())`. As far as I know, the module folder name does not have to be capitalized – andrewtweber Jun 29 '12 at 23:23
  • Just found the solution. Was really my fault. I forgot to add the bootstrap file for my module and the variable ressources.modules[] = "" in application.ini – maniak Jun 29 '12 at 23:44

2 Answers2

1

Found the solution, I had forgot the bootstrap.php file for the module and the variable ressources.modules[] = "" in application.ini. Here's a topic I was able to find when I realized that it was only happening for the models inside a module : zend modules models

Community
  • 1
  • 1
maniak
  • 442
  • 5
  • 22
0

The linux server cut the name of the class to generate the patch of the class file, in this case, do this:

$affaireMapper = new affaire_models_AffaireMapper();

end rename the class to:

affaire_models_AffaireMapper

fvrghl
  • 3,642
  • 5
  • 28
  • 36
Kenny Rafael
  • 113
  • 8