SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ::==:: Bonzo_CS's Avatar
    Join Date
    Dec 2003
    Location
    (Cardiff Wales)
    Posts
    747
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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]
    And my index.php file is as suggested :
    //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();
    I have placed the zend library in 'usr/share/php' and all seems to be fine.

    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

  2. #2
    ::==:: Bonzo_CS's Avatar
    Join Date
    Dec 2003
    Location
    (Cardiff Wales)
    Posts
    747
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •