It would be good if we could see the code of your category module files.
First of all, you should consider if you actually need a new module for this, since probably it should be in the same module, just creating new model classes and new views (if there is some). Anyways, at this point it doesnt matter.
If you are using the SkeletonApplication i suppose in your Album module, in Module.php you have this code:
public function getServiceConfig()
{
return array(
'factories' => array(
'Album\Model\AlbumTable' => function($sm) {
$tableGateway = $sm->get('AlbumTableGateway');
$table = new AlbumTable($tableGateway);
return $table;
},
'AlbumTableGateway' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Album());
return new TableGateway('album', $dbAdapter, null, $resultSetPrototype);
},
),
);
}
And then probably you created something similar for your category tables, something like
public function getServiceConfig()
{
return array(
'factories' => array(
'Category\Model\CategoryTable' => function($sm) {
$tableGateway = $sm->get('CategoryTableGateway');
$table = new CategoryTable($tableGateway);
return $table;
},
'CategoryTableGateway' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Album());
return new TableGateway('category', $dbAdapter, null, $resultSetPrototype);
},
),
);
}
Let me know if it is much diferent.
Since all the configuration is merged, in your controller your service manager can locate also the Category\Model\CategoryTable no matter if you are in other module.
So, you have to modify your AlbumForm class, so for instance in the constructor you can pass the dependencies, for example servicemanager, or 'Category\Model\CategoryTable' so when you need to retrieve the $selectOptions list, you can access it to make any query.
Also, you can take a look at more fine solutions like this from samsonasik, but it can be harder to understand.
And also, you can check this blog post and code from jamescarr to achieve more or less the same that you need. It is really easy to understand, and it is a good solution.