Hi!

I am using the Conventional Modular Directory Layout and am not able to
execute additional Actions belonging to the IndexController of any module.
Additional Actions belonging to any other controller work just fine.

I.e.
indexAction from IndexController from Default module works:
http://localhost/
anotherAction from IndexController from Default module does not work:
http://localhost/another/
indexAction from AditionalController from Default module works:
http://localhost/aditional/
anotherAction from AditionalController from Default module works:
http://localhost/aditional/another/

indexAction from IndexController from Rictloader module works:
http://localhost/rictloader/
anotherAction from IndexController from Rictloader module does not work:
http://localhost/rictloader/another/
indexAction from AditionalController from Rictloader module works:
http://localhost/rictloader/aditional/
anotherAction from AditionalController from Rictloader module works:
http://localhost/rictloader/aditional/another/

Basically my question is: how do I get other Actions from the
IndexControllers to work?

The Exception I am receiving is: Zend_Controller_Dispatcher_Exception:
Invalid controller specified (another) [...]

It seems it is looking for anotherController without trying to run
anotherAction of the IndexController first.

On a related question (if I get this setup working): which one would have
precedence: an Action belonging to the IndexController or the indexAction
belonging to another Controller with the same name as the Action belonging
to the IndexController?
To explain myself better:
http://localhost/another/
Could just as well be anotherAction from IndexController or indexAction from
Anothercontroller.

This is my Directory Layout (any comments regarding the Layout are also very
much appreciated):
application/
    config/
    modules/
        default/
            controllers/
                IndexController.php
                AditionalController.php
            models/
            views/
                scripts/
                    index/
                        index.phtml
                        another.phtml
                    aditional/
                        index.phtml
                        another.phtml
        rictloader/
            controllers/
                IndexController.php
                AditionalController.php
            models/
            views/
                scripts/
                    index/
                        index.phtml
                        another.phtml
                    aditional/
                        index.phtml
                        another.phtml
    views/
        scripts/
            header.phtml
            footer.phtml
html/
    index.php
    .htaccess
library/
    Zend/
tmp/

This is my index.php:
<?php
error_reporting(E_ALL|E_STRICT);
date_default_timezone_set('Europe/London');
set_include_path( get_include_path() . PATH_SEPARATOR . '../library' );

include "Zend/Loader.php";

function __autoload($class)
{
    Zend_Loader::loadClass($class);
}

$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->addModuleDirectory('../application/modules');
$frontController->setParam('globalViewPath', '../application/views');

$frontController->dispatch();
-------------

This is my IndexController in /application/modules/default/:
<?php
 
class IndexController extends Zend_Controller_Action 
{
    
    public function init()
    {
        $view = $this->initView();  
        $globalViewPath = $this->getInvokeArg('globalViewPath');
        $view->addScriptPath($globalViewPath . '/scripts')
             ->addHelperPath($globalViewPath . '/helpers')
             ->addFilterPath($globalViewPath . '/filters'); 
    } 
    
    public function indexAction()
    {
        $this->view->title = 'This is the indexAction of the IndexController
of the Default module';
    }
    
    public function anotherAction()
    {
        $this->view->title = 'This is the anotherAction of the
IndexController of the Default module';
    }
    
}

-------------

This is my IndexController in /application/modules/rictloader/:
<?php

class Rictloader_IndexController extends Zend_Controller_Action
{
    
    public function init()
    {
        $view = $this->initView();  
        $globalViewPath = $this->getInvokeArg('globalViewPath');
        $view->addScriptPath($globalViewPath . '/scripts')
             ->addHelperPath($globalViewPath . '/helpers')
             ->addFilterPath($globalViewPath . '/filters'); 
    } 
    
    public function indexAction()
    {
        $pato = Zend_Registry::get('pato');
        $this->view->title = 'This is the indexAction of the IndexController
of the Rictloader module';
    }
    
    public function anotherAction()
    {
        $this->view->title = 'This is the anotherAction of the
IndexController of the Rictloader module';
    }
    
}

------

I am not posting the contents of anotherController because those work just
fine.

Thanks for any help, advice, pointers and/or tips!

Cheers,


Antonio

P.S. The [EMAIL PROTECTED] chat is always empty... has it
been moved somewhere else?
-- 
View this message in context: 
http://www.nabble.com/Conventional-Modular-Directory-Layout-and-multiple-actions-on-the-IndexController-tf4493311s16154.html#a12814936
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to