I have another little prolblem executing my project structured on Zend Framework
I am new of php OO so I am studying all steps to build an application based on MVC pattern.
Under the folder c:\xampp\htdoc\ I have the folder tree of my project.
data
- logs
- tmp
- upload-files
htdocs
- .htaccess
- index.php
include
- Controllers
- - IndexController.php
- Zend
templates
in index.php I have written:
Code: Select all
<?php
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
$controller=Zend_Controller_Front::getInstance();
$controller->setControllerDirectory("../include/Controllers");
$controller->dispatch();
?> Code: Select all
<?php
class IndexController extends Zend_Controller_Action{
public function indexAction(){
echo "Web site home";
}
}
?> Now I have some doubts:
1) it seems that apache includes the internal libraries in C:\xampp\php\PEAR\Zend and not my libraries. Why?
2) when I run my application on the browser this error occours:
3) I use Eclipse IDE with some plugin for PHP. In the editor the rowFatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in C:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 C:\xampp\php\PEAR\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 C:\xampp\htdocs\zend\htdocs\index.php(8): Zend_Controller_Front->dispatch() #2 {main} thrown in C:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php on line 242
Code: Select all
require_once 'Zend/Loader/Autoloader.php'; Include filename: 'Zend/Loader/Autoloader.php' doesn't exist in project: /zend
but There aren`t errors for classes and function not definied.
This is not a problem, just a curiosity... Why the call to Autoloader is working well if the path seems wrong?
I will be so pleased if you can help me
Thanks!