Zend Framework MVC 2 - Module, Route-mapping funktioniert nicht

Ich versuche zu Folgen Akrabats Tutorial die Anwendung/Index arbeitet, ist das Album Teil nicht.

Ich versuchte es auch mit der ZendSkeletonModule mit kein Glück.

Den Fehler in beiden Fällen:

album/album (resolves to invalid controller class or alias: album/album)

Versuchte ich es mit ZF2 master und beta4-tag (aber beta4 tag gibt php Fehlermeldung über fehlende Methode getEventManager)

Ich habe den code aus Akrabats Tutorial, und nachdem der fehlgeschlagen ist, verwendet die code-form der GitHub Repo. Leider gibt es nicht ein Forum oder Kommentar-Abschnitt, um Hilfe zu bitten.

Fand ich einige diffrences in das tutorial und das Skelett (zfcUser hat die gleichen Unterschiede) in der module.config.php (was ich glaube, ist der Kern des Problems).

Dem tutorial verwendet classes im controller index, zfcUser und das Skelett mit invokables aber es scheint nicht zu Rolle, da sich der Fehler nicht ändern.

mein Modul.config sieht derzeit ungefähr so aus:

<?php

return array(

    //Controllers in this module
    'controller' => array(
        'invokables' => array(
            'album/album' => 'Album\Controller\AlbumController',
        ),        
    ),


    //Routes for this module
    'router' => array(
        'routes' => array(
            'album' => array(
                'type' => 'Literal',
                'priority' => 1000,
                'options' => array(
                    'route' => '/album',
                    'defaults' => array(
                        'controller' => 'album/album',
                        'action' => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array( 
                    'misc' => array (
                        'type'    => 'segment',
                        'options' => array(
                            'route'    => '/album/[:action][/:id]',
                            'constraints' => array(
                                'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'id'     => '[0-9]+',
                            ),
                            'defaults' => array(
                                'controller' => 'album/album',
                                'action'     => 'index',
                            ),
                        ),
                    ),
                ),
            ),
        ),
    ),    

    //View setup for this module
    'view_manager' => array(
        'template_path_stack' => array(
            'album' => __DIR__ . '/../view',
        ),
    ),
);

Album\Controller\AlbumController:

<?php

namespace Album\Controller;

use Zend\Mvc\Controller\ActionController,
    Zend\View\Model\ViewModel,
    Album\Model\AlbumTable,
    Album\Model\Album,
    Album\Form\AlbumForm;

class AlbumController extends ActionController
{
//[....]
}

Ich weiß nicht, wo Sie zu suchen um diesen Fehler zu beheben, hat jemand von Euch eine Idee?

Code ist wie orginal auf github (siehe links oben), wenn nicht anders erwähnt.

TIA

InformationsquelleAutor Rufinus | 2012-07-05

Schreibe einen Kommentar