Results 1 to 4 of 4

Thread: Modules / Controllers / Actions

  1. #1
    Eric_The_Red is offline Junior Member
    Join Date
    May 2008
    Posts
    3

    Default Modules / Controllers / Actions

    Working on moving a site onto the Zend Framework and I seem to be missing something.

    Have the following File / Dir structure
    Code:
    /application
        /modules
            /registration
                /controllers
                    Registration_FormsController.php
                    Registration_IndexController.pfp
                /views
                    /scripts
                        /forms
                           adult.phtml
                           child.phtml
                        /index
                            index.phtml
            /default
                /controllers
                    IndexController.php
                /views
                    /scripts
                        /index
                            index.phtml
    When I go to:
    http://localhost/index/ - loads index.phtml from default module
    http://localhost/registration/ - loads index.phtml from registration module
    http://localhost/registration/forms loads index.phtml from registration module
    http://localhost/registration/forms/child throws an action exception (no child)

    The last 2 I am at a loss on why they act that way or what I am missing

    Bootstrap sets:
    [php]
    self::$frontController->addModuleDirectory('../application/modules');
    [/php]

    Registration_FormsController.php is:
    [php]
    require_once 'Zend/Controller/Action.php';
    class FormsController extends Zend_Controller_Action
    {
    public function childAction()
    {

    }
    }
    [/php]

    Have been going through tutorials / forums etc for about 8 hours trying to figure out what if anything I am missing or not understanding and keep hitting a brick with it.

    Any help / advice etc is appreciated. Thanks!

  2. #2
    kuba is offline Junior Member
    Join Date
    Mar 2008
    Posts
    26

    Default

    as i remeber you should name your file FormsController.php and class name should be Registration_FormsController :P

  3. #3
    Eric_The_Red is offline Junior Member
    Join Date
    May 2008
    Posts
    3

    Default

    DOH that did it. Works Perfectly now.

    Misread an error message or tutorial somewhere to get the Registration_FormsController.php and had tried the Registration_FormsController class to no avail.

    Thanks a mil! Once I get all this figured out the first time around the other 20 or so websites I plan to convert over to ZF should go much easier. This first one is deffinately being a bear though.

  4. #4
    firecall is offline Junior Member
    Join Date
    May 2008
    Posts
    10

    Default

    Quote Originally Posted by kuba View Post
    as i remeber you should name your file FormsController.php and class name should be Registration_FormsController :P
    Ahah!

    Awesome, thanks - the docs arnt clear on this:

    Zend Framework: Documentation

    Sometimes the ZEND docs can be a bit heavy on the geek language - whom ever writes them needs a few classes on using plain-and-simple english

Similar Threads

  1. Replies: 4
    Last Post: 10-02-2009, 03:39 PM
  2. One function for all Actions and Controllers
    By madmaxious in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 04-18-2008, 02:26 PM
  3. modules, controllers, directory structure and urls
    By laz0rama in forum General Q&A on Zend Framework
    Replies: 6
    Last Post: 03-05-2008, 03:21 PM
  4. Problem with Controllers and actions
    By robferez in forum General Q&A on Zend Framework
    Replies: 3
    Last Post: 08-20-2007, 09:21 PM
  5. Zend_Acl, controllers, actions and HTML Blocks
    By Dead_Thinker in forum Authentication & Authorization
    Replies: 3
    Last Post: 07-31-2007, 06:02 AM

Posting Permissions

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