SilverStripe\CMS\Controllers\ContentController
The most common kind of controller; effectively a controller linked to a {@link DataObject}.
ContentControllers are most useful in the content-focused areas of a site. This is generally
the bulk of a site; however, they may be less appropriate in, for example, the user management
section of an application.
On its own, content controller does very little. Its constructor is passed a which is stored in $this->dataRecord. Any unrecognised method calls, for example, Title()
and Content(), will be passed along to the data record,
Subclasses of ContentController are generally instantiated by ModelAsController; this will create
a controller based on the URLSegment action variable, by looking in the SiteTree table.
Synopsis
class ContentController
extends Controller
{
- // members
- protected SiteTree $dataRecord;
- private static array $extensions = ;
- private static array $allowed_actions = ;
- private static array $casting = ;
- // methods
- public void __construct()
- public string Link()
- public SS_List ChildrenOf()
- public SiteTree Page()
- protected void init()
- public HTTPResponse handleRequest()
- public string project()
- public void data()
- public ArrayList getMenu()
- public void Menu()
- public MemberLoginForm LoginForm()
- public void SilverStripeNavigator()
- public void SiteConfig()
- public string ContentLocale()
- public SSViewer getViewer()
- public void successfullyinstalled()
- public void deleteinstallfiles()
Hierarchy
Extends
- SilverStripe\Control\Controller
Tasks
Line | Task |
---|---|
50+ | Can this be used for anything other than SiteTree controllers? |
341+ | Check if here should be returned just the default log-in form or all available log-in forms (also OpenID...) |
494 | Allow this to work when allow_url_fopen=0 |
Members
private
- $allowed_actions
- $casting
- $extensions
protected
- $dataRecord — SilverStripe\CMS\Model\SiteTree
Methods
protected
public
- __construct() — The ContentController will take the URLSegment parameter from the URL and use that to look up a SiteTree record.
- ChildrenOf() — Return the children of a given page. The parent reference can either be a page link or an ID.
- ContentLocale() — Returns an RFC1766 compliant locale string, e.g. 'fr-CA'.
- Link() — Return the link to this controller, but force the expanded link to be returned so that form methods and similar will function properly.
- LoginForm() — Returns the default log-in form.
- Menu()
- Page()
- SiteConfig()
- data() — Returns the associated database record
- deleteinstallfiles()
- getMenu() — Returns a fixed navigation menu of the given level.
- getViewer() — Return an SSViewer object to render the template for the current page.
- handleRequest() — This acts the same as {@link Controller::handleRequest()}, but if an action cannot be found this will attempt to fall over to a child controller in order to provide functionality for nested URLs.
- project() — Get the project name
- successfullyinstalled() — This action is called by the installation system