I am new to PHP and Zend Framework. Coming from a Java background. Having started PHP and Zend Framework at the same time using the Tutorial. Just want to share
my experience on my mistakes.
1. The AlbumController.php should be placed on the Application's module.config.php controller key section.
if not, you will keep having the zend Framework index page.
'router' => [
'routes' => [
'home' => [
'type' => Literal::class,
'options' => [
'route' => '/',
'defaults' => [
'controller' => AlbumController::class, //here is the point.
'action' => 'index',
2. If you ever get Call to a member function fetchAll() on null exception.
First check your constructor. PHP uses __ ie two underscores to define constructors. Nest check the $this->table.
The Constructor has to be defined properly and initialized for you to have an object of AlbumTable.
Hope this will help as I could not find anywhere online that talked about this issue. Except for problem 1. Though, later
specified in the tutorial later pages.
For programming and general questions on Zend Framework
1 post • Page 1 of 1