원클릭으로
add-route
Add a new route and controller action to this Omeka S module. Invoke with a short description, e.g. /add-route admin export endpoint
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add a new route and controller action to this Omeka S module. Invoke with a short description, e.g. /add-route admin export endpoint
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Attach a new Omeka S event listener in Module.php. Invoke with a description, e.g. /add-event log media updates
Add a new Laminas service (with factory) to this Omeka S module. Invoke with the service name, e.g. /add-service MyNewService
Run the full translation workflow — extract strings, update .po files, check for untranslated strings, and compile .mo files.
Package the module for distribution. Invoke with a version number, e.g. /release 1.2.3
Run the full CI verification pipeline locally — lint, unit tests, and 90% coverage check. Use after making changes to confirm they are ready.
| name | add-route |
| description | Add a new route and controller action to this Omeka S module. Invoke with a short description, e.g. /add-route admin export endpoint |
Add a new route and controller action for: $ARGUMENTS
config/module.config.phpPublic/API route (standalone):
'router' => [
'routes' => [
'exelearning-myroute' => [
'type' => \Laminas\Router\Http\Segment::class,
'options' => [
'route' => '/exelearning/my-route[/:id]',
'constraints' => ['id' => '\d+'],
'defaults' => [
'__NAMESPACE__' => 'ExeLearning\Controller',
'controller' => 'MyController',
'action' => 'myAction',
],
],
],
],
],
Admin child route (under /admin):
'admin' => [
'child_routes' => [
'exelearning-myroute' => [
'type' => \Laminas\Router\Http\Segment::class,
'options' => [
'route' => '/exelearning/my-route[/:id]',
'constraints' => ['id' => '\d+'],
'defaults' => [
'__NAMESPACE__' => 'ExeLearning\Controller',
'controller' => 'MyController',
'action' => 'myAction',
],
],
],
],
],
Use Literal for fixed paths, Segment for paths with :param, Regex for paths needing slashes inside a segment (like exelearning-content).
In src/Controller/MyController.php:
public function myActionAction()
{
// Check ACL if needed:
$acl = $this->getServiceLocator()->get('Omeka\Acl');
if (!$acl->userIsAllowed('Omeka\Entity\Media', 'read')) {
return $this->redirect()->toRoute('login');
}
$id = $this->params('id');
// ...
return new \Laminas\View\Model\ViewModel(['data' => $data]);
}
For JSON responses: return new \Laminas\View\Model\JsonModel(['key' => 'value']);
Create view/exe-learning/my-controller/my-action.phtml.
PHP: $this->url('exelearning-myroute', ['id' => $id])
JS: Use $request->getBasePath() prefix — the module supports playground prefix environments.
Add a controller test in test/ExeLearningTest/Controller/ following ApiControllerTest.php as the example.