SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Oct 19, 2008, 14:51 #1
Zend Framework Controller not working?
Hi All,
I am getting into the Zend Framework and have been following the screencasts provided by Zend. (http://framework.zend.com/docs/screencasts)
All seems to be going well and the screencasts are great, but I think I missed something in the configuration which I can't seem to solve.
Bascially I have set up the suggested .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
//Error Reporting
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors','on');
//Send Framework Includes
require_once "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Controller_Front');
//Get the front controller instance
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory('../application/controllers');
$front->throwExceptions(true);
//Start the request and dispatch
$front->dispatch();
The problem I am having though is when I create a controller it doesn't seem to find the view. In the tutorial for instance it suggests that I should be able to go to:
test is setup in the IndexController.php as testAction and has a script test.phtml
If I request http://localhost I do actually get the controller and view.
However I just get a page not found? Not even an exception which I thought I should be getting as they are on?
Has anyone else experienced this or can suggest a solution ?
Thanks
-
Oct 19, 2008, 17:03 #2
Found the problem, which I should have spotted a lot sooner. In my http.conf I needed to allow the .htaccess with AllowOverride All.
Works fine now.
Bookmarks