Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR: remove dependency on RootURLController and show a default Cont…

…roller template as a failback.
  • Loading branch information...
commit 8b43780e23745b65766e376a7261adfd51a1de4a 1 parent eb2a042
@wilr wilr authored chillu committed
View
10 _config/routes.yml
@@ -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'
View
4 control/Controller.php
@@ -274,6 +274,7 @@ function getViewer($action) {
$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 @@ function getViewer($action) {
$parentClass = get_parent_class($parentClass);
}
+ $templates[] = 'Controller';
+
// remove duplicates
$templates = array_unique($templates);
}
+
return new SSViewer($templates);
}
View
22 templates/Controller.ss
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.