You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's another concrete example of the utter insufficiency of the Omeka documentation.
I'll explain what I want to do so that you can understand what's missing in the documentation that would allow me to learn how to accomplish that.
I created a plugin, let's say it's called MyPlugin.
In this plugin I created a controlled called WhateverController which has a Show action (i.e. a showAction method).
Without doing anything else, that automatically gives me an url http://mydomain.com/my-plugin/whatever/show which runs the abovementioned action.
However:
1. The url http://mydomain.com/my-plugin/whatever/show/123 does not automagically populate an id parameter with the value 123, as it happens with the application's builtin controllers.
That is, if in WhateverController::showAction() I try to run:
$id = $this->getRequest()->getParam('id');
that does not work. It returns null or an otherwise empty value.
So, I searched the documentation but found nothing about routes and how to customize them.
I also looked at the source code but it's too complex.
So, the first basic thing that the documentation fails to address is:
How do you configure your plugin's routes so that they have the same basic default behavior of Omeka's builtin routes, where the pattern :controller/:action/:id gives you a request parameter called id.
Or called something else, which is another thing I wanted to do.
(I'm not sure whether this is something that can be entirely addressed at the plugin level or if I need to edit the application configuration to accomplish this; if it's the latter then there's a big flaw in the plugin architecture but for now I could live with that as long as somebody tells me how to do that. Either way it should be in the docs)
Much of this stuff works seems to be handled by the Zend Framework, which is also poorly documented, at least this version (not nearly as poorly as Omeka, of course), but it doesn't help that Omeka's documentation says absolutely nothing of which features of Zend exactly it is using and how.
2.
I would like some of the plugin controllers, whose names I know don't clash with any builtin controller, to be accessed without the plugin name as a prefix
That is, I would like to have this url:
http://mydomain.com/whatever/show
instead of http://mydomain.com/my-plugin/whatever/show, to be mapped to my plugin's WhateverController::showAction()
There must be a way to do that. It can't be that I'm condemned to have all the urls that are handled by my plugin's controllers start with the plugin name.
Again, this is probably handled by Zend and it may be documented in Zend's documentation, but Omeka's documentation gives me no clue where to look or even what to look for.
I know I can address both with Apache rewrite rules in .htaccess, but there must be a cleaner way.
The text was updated successfully, but these errors were encountered:
This is a pretty solid issue except that you just can't seem to resist getting your little digs in even though I've asked you repeatedly not to do that. So, I'm going to go ahead and block you from interacting with the Omeka organization's issue trackers.
Here's another concrete example of the utter insufficiency of the Omeka documentation.
I'll explain what I want to do so that you can understand what's missing in the documentation that would allow me to learn how to accomplish that.
I created a plugin, let's say it's called
MyPlugin
.In this plugin I created a controlled called
WhateverController
which has aShow
action (i.e. ashowAction
method).Without doing anything else, that automatically gives me an url
http://mydomain.com/my-plugin/whatever/show
which runs the abovementioned action.However:
1. The url
http://mydomain.com/my-plugin/whatever/show/123
does not automagically populate anid
parameter with the value 123, as it happens with the application's builtin controllers.That is, if in
WhateverController::showAction()
I try to run:that does not work. It returns null or an otherwise empty value.
So, I searched the documentation but found nothing about routes and how to customize them.
I also looked at the source code but it's too complex.
So, the first basic thing that the documentation fails to address is:
:controller/:action/:id
gives you a request parameter calledid
.Or called something else, which is another thing I wanted to do.
(I'm not sure whether this is something that can be entirely addressed at the plugin level or if I need to edit the application configuration to accomplish this; if it's the latter then there's a big flaw in the plugin architecture but for now I could live with that as long as somebody tells me how to do that. Either way it should be in the docs)
Much of this stuff works seems to be handled by the Zend Framework, which is also poorly documented, at least this version (not nearly as poorly as Omeka, of course), but it doesn't help that Omeka's documentation says absolutely nothing of which features of Zend exactly it is using and how.
2.
I would like some of the plugin controllers, whose names I know don't clash with any builtin controller, to be accessed without the plugin name as a prefix
That is, I would like to have this url:
instead of
http://mydomain.com/my-plugin/whatever/show
, to be mapped to my plugin'sWhateverController::showAction()
There must be a way to do that. It can't be that I'm condemned to have all the urls that are handled by my plugin's controllers start with the plugin name.
Again, this is probably handled by Zend and it may be documented in Zend's documentation, but Omeka's documentation gives me no clue where to look or even what to look for.
I know I can address both with Apache rewrite rules in
.htaccess
, but there must be a cleaner way.The text was updated successfully, but these errors were encountered: