Last active
February 6, 2023 04:09
-
-
Save parotikov/9449e62c18740596b669537715789f0f to your computer and use it in GitHub Desktop.
October CMS route in plugin, using custom controller action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace nikparotikov\testplugin\classes; | |
use Cms\Classes\CmsController; | |
class BaseController extends CmsController { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace nikparotikov\testplugin\classes; | |
use nikparotikov\testplugin\classes\BaseController; | |
use Response; | |
class CharacterController extends BaseController { | |
public function index() | |
{ | |
return Response::make(['message' => 'hello'], 200); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::group(['namespace' => 'nikparotikov\testplugin\classes'], function() | |
{ | |
Route::get('/testapi', 'CharacterController@index'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment