404 The requested URL could not be matched by routing
thanks to Crisp for mentioning the url in comment.
there is a missing link between zend skeleton application and routing and controllers where the initial module structure and module file code is written.
the code in my Module.php
was missing is
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements AutoloaderProviderInterface, ConfigProviderInterface {
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getConfig() {
return include __DIR__ . '/config/module.config.php';
}
}
Mohammad Faisal
@faisal6621 facebook linkedin Er. Mohammad Faisal (Blogger) Er. Mohammad Faisal (Wordpress) If you are looking for something to vote on, I'm looking for votes (ideally upvotes 🤪) on [my questions/answers with zero][1]...
Updated on June 04, 2022Comments
-
Mohammad Faisal almost 2 years
I'd just started to learn zend-framework and following this user guide.
I'm able to successfully install the
zend skeleton application
and moved on to therouting and controllers
. But after completion of the tutorial I requested the url:http://zf2-tutorial.localhost/album
in my browser and I'm getting404
.I'd looked down into the comments where some people saying about changes in
'route' => '/album[/][:action][/:id]'
needs to be
'route' => '/album[/:action][/:id]'
but that doesn't help either. Can anyone help me in resolving the issue?
Directory structure:
-
Sam about 10 yearsIt's a tutorial, better start from page 1 ;)
-
Mohammad Faisal about 10 years@Sam and where's the page 1?
-
Mohammad Faisal about 10 yearsafter this I'd chosen
getting started zend framework 2
. after that in the next pages, there's the missing link which I'd mentioned in my answer -
Sam about 10 yearsYou sir, are actually right, excuse me - idk what happened with the docs ;)