Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Pluginy się nie ładują
masterix
post
Post #1





Grupa: Zarejestrowani
Postów: 93
Pomógł: 0
Dołączył: 7.09.2004

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


Witam,

Mam problem z autoloaderem. Rozkład katalogów wygląda mniej więcej tak:
- application
--modules
--configs
-library
--Zend
--ZendX
-public
-TLS
--Controller
---Plugin
----LayoutDirectory.php

I w Bootstrap.php mam kod:
  1. <?php
  2. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  3. {
  4.    protected function _initAutoload()
  5.    {
  6.        $autoloader = new Zend_Application_Module_Autoloader(array(
  7.            'namespace' => 'Default_',
  8.            'basePath'  => dirname(__FILE__),
  9.        ));
  10.        //$autoloader->registerNamespace('TLS_');
  11.        return $autoloader;
  12.    }
  13.  
  14.    protected function _initView()
  15.    {
  16.        // Initialize view
  17.        $view = new Zend_View();
  18.        $view->doctype('XHTML1_STRICT');
  19.        $view->headTitle('My First Zend Framework Application');
  20.  
  21.        $view->addHelperPath( 'TLS/View/Helper', 'TLS_View_Helper' );
  22.  
  23.        // Add it to the ViewRenderer
  24.        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
  25.        $viewRenderer->setView($view);
  26.  
  27.        // Return it, so that it can be stored by the bootstrap
  28.        return $view;
  29.    }
  30.  
  31.    protected function _initControllers()
  32.    {
  33.        $this->bootstrap('FrontController');
  34.        $this->frontController->addModuleDirectory(APPLICATION_PATH.'/modules');
  35.        $this->frontController->registerPlugin(new TLS_Controller_Plugin_LayoutDirectory());
  36.        $this->frontController->registerPlugin(new TLS_Controller_Plugin_ModelDirectory());
  37.    }
  38. }
  39. ?>
No i niestety wywala się wszystko przy registerPlugin:
Fatal error: Class 'TLS_Controller_Plugin_LayoutDirectory' not found in...

Próbowałem registerNamespace, ale chyba w ZF1.8 już to nie działa. Próbowałem dodać do include_path, ale też nie bardzo. Jak to rozryźć?

pzdr.
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 23.12.2025 - 05:02