in SilverStripe, routing for actions on pages always works the same way:
$baseURL/$URLSegment/Action
this means that if you do /someaction
it will not look for an action, instead it will look for a Page with an URLSegment of someaction
.
so if you want to call an action on your homepage, you have to include the URLSegment.
that is usually /home/someaction
however, I strongly recommend using the $Link
method.
$Link('someaction') // will output /home/someaction
// alternatively you can also do $Link/someaction
also note:
- private static variables like
$allowed_actions
are cached, you have to flush (visit/?flush=1
) to get SilverStripe to reload that cache. $BaseHref
is deprecated, please use$baseURL
or$absoluteBaseURL
instead.