Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ZF] Nie odnajduje klasy formularza
Turson
post 3.05.2014, 20:13:16
Post #1





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

Ostrzeżenie: (0%)
-----


Taki oto komunikat otrzymuję przy próbie stworzenia obiektu Users_Form_Register
Cytat
Fatal error: Class 'Users_Form_Register' not found in blabla\application\modules\users\controllers\IndexController.php

  1. $form = new Users_Form_Register();


Klasa formularza znajduje się w modules/users/forms/Register.php i nazywa się Users_Form_Register
modules/
--users/
----forms/
------Register.php

Domyślam się, że chodzi o autoloader i przestrzeń nazw klas.
W głównym bootstrapie dopisałem metodę
  1. function _initAutoloader() {
  2. $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
  3. 'basePath' => 'modules/users',
  4. 'namespace' => 'Users',
  5. ),
  6. 'basePath' => 'modules/users/forms',
  7. 'namespace' => 'Forms',
  8. )
  9. );
  10. return $resourceLoader;
  11. }

efektu to nie zmienia

Rozwiązane
wystarczy dodać w configs/application.init w [production]:
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = "users"

Ten post edytował Turson 3.05.2014, 22:11:15
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 23.06.2025 - 07:50