Comments: on this page. Click to read or post your own.
Base controller class.
Controllers are the cornerstone of all site functionality in Sapphire. The Director selects a controller to pass control to, and then calls run(). This method will execute the appropriate action - either by calling the action method, or displaying the action's template.
See getTemplate() for information on how the template is chosen.
Located in /sapphire/core/control/Controller.php (line 12)
Object | --ViewableData | --RequestHandler | --Controller
| Class | Description |
|---|---|
| Upload | Manages uploads via HTML forms processed by PHP, uploads to Silverstripe's default upload directory, and either creates a new or uses an existing File-object for syncing with the database. |
| ControllerTest_Controller | Simple controller for testing |
| ControllerTest_SecuredController | Controller with an $allowed_actions value |
| RequestHandlingTest_Controller | Controller for the test |
| RequestHandlingTest_AllowedController | Controller for the test |
| TableFieldTest_Controller | Stub controller |
| FormTest_Controller | Base controller class. |
| TableListFieldTest_TestController | Base controller class. |
| RestfulServiceTest_Controller | Base controller class. |
| CliController | Base class invoked from CLI rather than the webserver (Cron jobs, handling email bounces). |
| Security | Implements a basic security model |
| DevelopmentAdmin | Base class for URL access to development tools. Currently supports the ; and TaskRunner. |
| JSTestRunner | Controller that executes QUnit tests via jQuery. |
| SapphireREPL | Base controller class. |
| TaskRunner | |
| ModelViewer | Gives you a nice way of viewing your data model. |
| SapphireInfo | Returns information about the current site instance. |
| CodeViewer | Allows human reading of a test in a format suitable for agile documentation |
| InstallerTest | Simple controller that the installer uses to test that URL rewriting is working. |
| TestViewer | Allows human reading of a test in a format suitable for agile documentation |
| TestRunner | Controller that executes PHPUnit tests. |
| ReportField_Controller | This class instantiates an instance of the report field and receives ajax requests to the report field. |
| ContentController | The most common kind of controller; effectively a controller linked to a DataObject. |
| RootURLController | This controller handles what happens when you visit the root URL. |
| ModelAsController | ModelAsController will hand over all control to the appopriate model object It uses URLSegment to determine the right object. Also, if (ModelClass)_Controller exists, that controller will be used instead. It should be a subclass of ContentController. |
| DatabaseAdmin | DatabaseAdmin class |
| Image_Uploader | Uploader support for the uploading anything which is a File or subclass of File, eg Image. |
| Email_BounceHandler | Base class that email bounce handlers extend |
| VersionedRestfulServer | Simple wrapper to allow access to the live site via REST |
| RestfulServer | |
| SapphireSoapServer | Soap server class. |
| WidgetFormProxy | |
| Widget_Controller | Base controller class. |
| LeftAndMain | LeftAndMain is the parent class of all the two-pane views in the CMS. |
| CMSHelp | Base controller class. |
| ImageEditor | This Controller handles all operation needed for ImageEditor to work(expect for GD operations). |
| StaticExporter | This class lets you export a static copy of your site. |
| ModelAdmin_CollectionController | Handles a managed model class and provides default collection filtering behavior. |
| ModelAdmin_RecordController | Handles operations on a single record from a managed model. |
| PageComment_Controller | Base controller class. |
| BatchProcess_Controller | Base controller class. |
| RebuildStaticCacheTask | |
| SiteTreeMaintenanceTask | |
| OrderReport_Popup | This is a stand-alone controller, designed to be used with the eCommerce reporting system. |
| WorldpayPayment_Handler | Handler for responses from the WorldPay site |
| PayPalPayment_Handler | Handler for responses from the PayPal site |
| PaystationHostedPayment_Handler | Handler for responses from the PayPal site |
| ShoppingCart_Controller | Base controller class. |
Stack of current controllers.
Controller::$controller_stack[0] is the current controller.
Default URL handlers - (Action)/(ID)/(OtherID)
The Session object for this controller
Inherited from ViewableData
ViewableData::$casting
ViewableData::$castingHelperPair_cache
ViewableData::$customisedObj
ViewableData::$failover
ViewableData::$iteratorPos
ViewableData::$iteratorTotalItems
ViewableData::$namedAs
ViewableData::$parent
ViewableData::$_natural_cache
ViewableData::$_object_cache
ViewableData::$_xml_cache
Inherited from Object
Object::$class
Object::$extensions
Object::$extension_instances
Tests whether we have a currently active controller or not
Joins two link segments together, putting a slash between them if necessary.
Use this for building the results of Link() methods.
If either of the links have query strings, then they will be combined and put at the end of the resulting url.
Returns an absolute link to this controller
Returns true if the member is allowed to do the given action.
Returns the currently logged in user
This is the default action handler used if a method doesn't exist.
It will process the controller object with the template returned by getViewer()
Call this to disable basic authentication on test sites.
must be called in the init() method
Returns the action that is being executed on this controller.
Return the object that is going to own a form that's being processed, and handle its execution.
Note that the result needn't be an actual controller object.
Get the request with which this controller was called (if any).
Usually set in handleRequest().
Returns the HTTPResponse object that this controller is building up.
Can be used to set the status code and headers
Get the Session object representing this Controller's session
Return an SSViewer object to process the data
Controller's default action handler. It will call the method named in $Action, if that method exists.
If $Action isn't given, it will use "index" as a default.
Handles HTTP requests.
If you are going to overload handleRequest, make sure that you start the method with $this->pushCurrent() and end the method with $this->popCurrent(). Failure to do this will create weird session errors.
Initialisation function that is run before any action on the controller is called.
Returns true if this controller is processing an ajax request
returns a date object for use within a template
Usage: $Now.Year - Returns 2006
Return true if the visitor has signed up for a login account before
Returns true if the visitor has been here before
Pop this controller off the top of the stack.
Pushes this controller onto the stack of current controllers.
This means that any redirection, session setting, or other things that rely on Controller::curr() will now write to this controller object.
Redirct to the given URL.
It is generally recommended to call Director::redirect() rather than calling this function directly.
Redirect back. Uses either the HTTP_REFERER or a manually set request-variable called _REDIRECT_BACK_URL.
This variable is needed in scenarios where not HTTP-Referer is sent ( e.g when calling a page by location.href in IE). If none of the two variables is available, it will redirect to the base URL (see Director::baseURL()).
Tests whether a redirection has been requested.
Render the current controller with the templates determined by getViewer().
Inherited From RequestHandler
RequestHandler::checkAccessAction()
RequestHandler::getRequest()
RequestHandler::handleRequest()
RequestHandler::httpError()
Inherited From ViewableData
ViewableData::ATT_val()
ViewableData::BaseHref()
ViewableData::buildCastingHelperCache()
ViewableData::cachedCall()
ViewableData::castingHelper()
ViewableData::castingHelperPair()
ViewableData::castingObjectCreator()
ViewableData::castingObjectCreatorPair()
ViewableData::CSSClasses()
ViewableData::CurrentMember()
ViewableData::CurrentPage()
ViewableData::customise()
ViewableData::Debug()
ViewableData::defineMethods()
ViewableData::escapeTypeForField()
ViewableData::Even()
ViewableData::EvenOdd()
ViewableData::First()
ViewableData::FirstLast()
ViewableData::getField()
ViewableData::getIterator()
ViewableData::getXMLValues()
ViewableData::hasField()
ViewableData::HasPerm()
ViewableData::hasValue()
ViewableData::i18nLocale()
ViewableData::IsAjax()
ViewableData::iteratorProperties()
ViewableData::JS_val()
ViewableData::Last()
ViewableData::Me()
ViewableData::Middle()
ViewableData::MiddleString()
ViewableData::obj()
ViewableData::Odd()
ViewableData::Pos()
ViewableData::RAW_val()
ViewableData::renderWith()
ViewableData::SecurityID()
ViewableData::setCustomisedObj()
ViewableData::setField()
ViewableData::SQL_val()
ViewableData::ThemeDir()
ViewableData::Top()
ViewableData::TotalItems()
ViewableData::val()
ViewableData::XML_val()
ViewableData::__get()
ViewableData::__isset()
ViewableData::__set()
Inherited From Object
Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::add_static_var()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::clearCache()
Object::combined_static()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::get_static()
Object::hasExtension()
Object::hasMethod()
Object::has_extension()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::remove_extension()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_static()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::uninherited_static()
Object::useCustomClass()
Object::__call()
Object::__toString()
Documentation generated on Mon, 23 Mar 2009 06:47:27 +1300 by phpDocumentor 1.3.2