Mam mały problem, otóż chciałbym zintegrować zf z systemem szablonów TWIG.
Znalazłem taki wątek: http://groups.google.com/group/twig-users/...1cf9e3cad767dad i korzystam z rady Benjamina Zikarsky'iego.
Mam taką strukturę projektu:
Kod
.
|-- application
| |-- Bootstrap.php
| |-- configs
| | |-- application.ini
| | |-- routes.ini
| | `-- session.ini
| |-- layouts
| | `-- scripts
| | |-- guide.phtml
| |-- models
| `-- modules
| |-- guide
| | |-- controllers
| | | |-- ErrorsController.php
| | | `-- StaticsController.php
| | |-- models
| | `-- views
| | |-- filters
| | |-- helpers
| | `-- scripts
| | |-- errors
| | | `-- error.phtml
| | `-- statics
| | |-- about.phtml
| | |-- advert.phtml
| | |-- contact.phtml
| | |-- cooperation.phtml
| | |-- index.phtml
| | |-- join.phtml
| | |-- privacy.phtml
| | `-- terms.phtml
|-- data
| |-- cache
|-- docs
|-- library
| |-- App
| |-- Twig
| | |-- Adapter
| | | `-- ZendView.php
| | |-- ...
| | |-- ...
| `-- Zend
|-- public
`-- tests
|-- application
| |-- Bootstrap.php
| |-- configs
| | |-- application.ini
| | |-- routes.ini
| | `-- session.ini
| |-- layouts
| | `-- scripts
| | |-- guide.phtml
| |-- models
| `-- modules
| |-- guide
| | |-- controllers
| | | |-- ErrorsController.php
| | | `-- StaticsController.php
| | |-- models
| | `-- views
| | |-- filters
| | |-- helpers
| | `-- scripts
| | |-- errors
| | | `-- error.phtml
| | `-- statics
| | |-- about.phtml
| | |-- advert.phtml
| | |-- contact.phtml
| | |-- cooperation.phtml
| | |-- index.phtml
| | |-- join.phtml
| | |-- privacy.phtml
| | `-- terms.phtml
|-- data
| |-- cache
|-- docs
|-- library
| |-- App
| |-- Twig
| | |-- Adapter
| | | `-- ZendView.php
| | |-- ...
| | |-- ...
| `-- Zend
|-- public
`-- tests
w bootstrapie robię tak:
Kod
protected function _initViews()
{
$view = new Twig_Adapter_ZendView();
$view->setScriptPath(APPLICATION_PATH.'/layouts/scripts/');
$viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper(
'ViewRenderer'
);
$viewRenderer->setView($view);
}
{
$view = new Twig_Adapter_ZendView();
$view->setScriptPath(APPLICATION_PATH.'/layouts/scripts/');
$viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper(
'ViewRenderer'
);
$viewRenderer->setView($view);
}
zaś w application.ini mam dopisana linijkę: autoloaderNamespaces[] = "Twig"
moje pytanie brzmi: Czemu wywala się taki błąd:
Cytat
Warning: include_once(Twig/Adapter/ZendView.php): failed to open stream: No such file or directory in /var/www/frameworks/Zend/library/Zend/Loader.php on line 146 Warning: include_once(): Failed opening 'Twig/Adapter/ZendView.php' for inclusion (include_path='/var/www/html/guide/application/../library:/var/www/html/guide/library:/var/www/frameworks/Zend/library') in /var/www/frameworks/Zend/library/Zend/Loader.php on line 146 Fatal error: Class 'Twig_Adapter_ZendView' not found in /var/www/html/guide/application/Bootstrap.php on line 18
skoro wszystkie pliki są na swoim miejscu?
Co uczynić by zadziałało ?
