I’m trying to develop a plug-in and I’m having trouble creating a route. I think I’m missing something when it comes to creating new routes. Any help would be much appreciated. Here is my file structure:
NeatlineAccessiblePage (plug-in directory)
- controllers (folder)
- NeatlineAccessiblePage_RecordsController.php
- NeatlineAccessiblePagePlugin.php
- plugin.ini
- plugin.php
NeatlineAccessiblePagePlugin.php
class NeatlineAccessiblePagePlugin extends Omeka_Plugin_AbstractPlugin
{
public $_hooks = array(
'define_routes'
);
public function hookDefineRoutes($args)
{
$router = $args['router'];
$route = new Zend_Controller_Router_Route(
'accessible-page',
array(
'controller' => 'records',
'action' => 'display',
'module' => 'neatline-accessible-page'
)
);
$router->addRoute('accessible-page', $route);
}
}
NeatlineAccessiblePage_RecordsController.php
class NeatlineAccessiblePage_RecordsController extends Omeka_Controller_AbstractActionController
{
public function displayAction()
{
echo "Hello";
exit();
}
}
http://localhost/omeka_install/accessible-page is returning a 404 and “Hello” is never printed. Any help would be much appreciated.