mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: remove dependency on RootURLController and show a default Controller template as a failback.
This commit is contained in:
parent
eb2a0427cc
commit
8b43780e23
@ -1,4 +1,11 @@
|
||||
---
|
||||
Name: rootroutes
|
||||
Before: '*'
|
||||
---
|
||||
Director:
|
||||
rules:
|
||||
'': 'Controller'
|
||||
---
|
||||
Name: coreroutes
|
||||
After: cms/routes#modelascontrollerroutes
|
||||
Before: '*'
|
||||
@ -19,5 +26,4 @@ After: framework/routes#coreroutes
|
||||
Director:
|
||||
rules:
|
||||
'admin': 'AdminRootController'
|
||||
'': 'RootURLController'
|
||||
'dev/buildcache/$Action': 'RebuildStaticCacheTask'
|
||||
'dev/buildcache/$Action': 'RebuildStaticCacheTask'
|
@ -274,6 +274,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
||||
$templates = $this->template;
|
||||
} else {
|
||||
// Add action-specific templates for inheritance chain
|
||||
$templates = array();
|
||||
$parentClass = $this->class;
|
||||
if($action && $action != 'index') {
|
||||
$parentClass = $this->class;
|
||||
@ -289,9 +290,12 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
||||
$parentClass = get_parent_class($parentClass);
|
||||
}
|
||||
|
||||
$templates[] = 'Controller';
|
||||
|
||||
// remove duplicates
|
||||
$templates = array_unique($templates);
|
||||
}
|
||||
|
||||
return new SSViewer($templates);
|
||||
}
|
||||
|
||||
|
22
templates/Controller.ss
Normal file
22
templates/Controller.ss
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<% base_tag %>
|
||||
|
||||
$MetaTags
|
||||
</head>
|
||||
<body>
|
||||
<h1><% if $Title %>$Title<% else %>Welcome to SilverStripe<% end_if %></h1>
|
||||
<% if $Content %>$Content<% else %>
|
||||
<p>To get started with the SilverStripe framework:</p>
|
||||
<ol>
|
||||
<li>Create a <code>Controller</code> subclass (<a href="http://doc.silverstripe.org/sapphire/en/topics/controller">doc.silverstripe.org/sapphire/en/topics/controller</a>)</li>
|
||||
<li>Setup the routes to your <code>Controller</code>.</li>
|
||||
<li>Create a template for your <code>Controller</code> (<a href="http://doc.silverstripe.org/sapphire/en/trunk/reference/templates">doc.silverstripe.org/sapphire/en/trunk/reference/templates</a>)</li>
|
||||
</ol>
|
||||
<% end_if %>
|
||||
<p><em>Generated with the default Controller.ss template.</em></p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user