MDL-84300 core: Support nested templates in routed API

This commit is contained in:
Andrew Nicols
2025-02-11 09:32:50 +08:00
parent 44e4aedc03
commit 49b0ef223f
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ class templates {
* @return payload_response
*/
#[route(
path: '/templates/{themename}/{component}/{identifier}',
path: '/templates/{themename}/{component}/{identifier:.*}',
method: ['GET'],
title: 'Fetch a single template',
description: 'Fetch a single template for a component in a theme',
+11 -1
View File
@@ -64,7 +64,17 @@ final class templates_test extends route_testcase {
['core/modal'],
[],
],
'foo' => [
'fetch nested template' => [
'boost/core/local/modal/alert',
[
'core/local/modal/alert',
'core/modal',
],
[
'moodle/ok',
],
],
'multiple templates' => [
'boost/core/notification',
[
'core/notification',