Let's say i have a FooController
extending Craft\BaseController
located somewhere else (not in a plugin). The FooController
is autoloaded via composer and the autoload.php is included in public/index.php
Would there be a way to route to this FooController
? Is it not possible with Craft (or Yii) to just say something laravel like: Route::get('foo/bar', 'FooController@bar')
?
Edit (follow up question):
If I have something like this in my registerSiteRoutes
function:
return [
'foo/bar' => ['action' => 'plugin/foo/bar', 'additional' => 'acme'],
];
Would I be able to access the 'additional' information in the controller?
controllers
directory in your plugin. One option, again perhaps not the only or best option, would be to use a controller in thecontroller
directory that is merely a wrapper to call the function elsewhere. Just a thought.