Theme callback to use when testing the theme callback functionality.
$argument: The argument passed in from the URL.
The name of the custom theme to request for the current page.
function menu_test_theme_callback($argument) {
// Test using the variable administrative theme.
if ($argument == 'use-admin-theme') {
return config('system.theme')
->get('admin');
}
elseif ($argument == 'use-stark-theme') {
return 'stark';
}
elseif ($argument == 'use-fake-theme') {
return 'fake_theme';
}
// For any other value of the URL argument, do not return anything. This
// allows us to test that returning nothing from a theme callback function
// causes the page to correctly fall back on using the main site theme.
}