In a custom extension I have created a few URL hooks as follows:
namespace MyExtension;
class Extension extends \Bolt\BaseExtension
{
public function initialize()
{
// audio sample management
$this->app->match("/foo", array($this, 'foo'));
$this->app->match("/bar", array($this, 'bar'));
}
function foo()
{
// ...
}
function bar()
{
// ...
}
}
I can hit both these functions via a url like so:
- example.com/foo
- example.com/bar
... and both will execute.
However when I add a page binding into the routing.yml
it breaks and it tries to look for foo
and bar
as if they were pages
.
pagebinding:
path: /{slug}
defaults: { _controller: 'Bolt\Controllers\Frontend::record', 'contenttypeslug': 'page' }
contenttype: pages
How can I have foo
and bar
without them being caught by this binding?
SOLUTION
Added the following routing snippet before my pagebinding
route.
foobinding:
path: /foo
defaults: { _controller: 'MyExtension\Extension::foo' }