Class Controller
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.
- Object
-
ViewableData
implements
IteratorAggregate
-
RequestHandler
-
Controller
Direct known subclasses
BatchProcess_Controller,
Cart_Controller,
FileDataObjectManager_Controller,
FindCyrillic_Controller,
GoogleSitemap,
ImageEditor,
InstallerTest,
JSTestRunner,
LeftAndMain,
LiveCalendarWidget_Controller,
ModelAdmin_CollectionController,
ModelAdmin_RecordController,
CliController,
ModelAsController,
ModelViewer,
MultiUploadControls,
OrderExporter,
PageComment_Controller,
Payment_Handler,
PhotoAlbumManager_Controller,
RebuildStaticCacheTask,
RemoveOrphanedPagesTask,
RestfulServer,
CodeViewer,
RootURLController,
SapphireInfo,
SapphireREPL,
SapphireSoapServer,
Security,
SiteTreeMaintenanceTask,
StaticExporter,
TaskRunner,
TestRunner,
TestViewer,
ContentController,
Upload,
VersionedRestfulServer,
Widget_Controller,
YMLExporter,
DatabaseAdmin,
DataObjectManager_Controller,
DatePickerField_Controller,
DevelopmentAdmin,
Email_BounceHandler
Indirect known subclasses
Announcement_Controller,
AnnouncementHolder_Controller,
CatalogAdmin_CollectionController,
SberbankPayment_Handler,
ScheduledTask,
Search_Controller,
SecurityAdmin,
ShippingMethodAdmin,
ShippingMethodAdmin_CollectionController,
SimpleOrderForm_Controller,
SimpleOrderPage_Controller,
SiteMap_Controller,
SOAPModelAccess,
CatalogAdmin_RecordController,
Socle_Controller,
SocleSize_Controller,
SpecialCatalog_Controller,
StartCatalog_Controller,
SubscribeForm_Controller,
SubsiteAdmin,
SubsiteAdmin_CollectionController,
SubsitesSelectorPage_Controller,
SubsitesVirtualPage_Controller,
UnitellerPayment_Handler,
CheckoutPage_Controller,
Unsubscribe_Controller,
UserDefinedForm_Controller,
VAT_Admin,
VideoBankPage_Controller,
VirtualPage_Controller,
VirtualProduct_Controller,
VKNotificationQueueAdmin,
WeeklyTask,
WidgetAdmin,
YaMoneyPayment_Handler,
ChequePayment_Handler,
YearlyTask,
CMSMain,
CommentAdmin,
ContactsPage_Controller,
CorrectBadFoldersTask,
CustomMenuAdmin,
DailyTask,
AssetAdmin,
DashboardAdmin,
DeleteEmptyAssociatedFoldersTask,
DeleteUnconfirmTask,
DocPage_Controller,
DocumentsPage_Controller,
ErrorPage_Controller,
Event_Controller,
EventHolder_Controller,
FaqAdmin,
FaqHolder_Controller,
BookingAdminPage_Controller,
FaqSection_Controller,
FavoritePage_Controller,
FillTechTitleTask,
FindCyrillic,
Guestbook_Controller,
GuestbookAdmin,
GuestbookAdmin_CollectionController,
HomePage_Controller,
HourlyTask,
HouseCatalogSearchWidget_Controller,
BookingOrderAdmin,
Import1C_Controller,
ImportCatalog1C_Controller,
ImportCatalog1C_ProcessTask,
ImportCatalog1C_ProductProp_Admin,
LastDoc_Controller,
LoggerAdmin,
LoggerAdmin_CollectionController,
LoggerAdmin_RecordController,
MapObject_Controller,
MapObjectGroup_Controller,
BookingOrderAdmin_CollectionController,
MapPage_Controller,
MediawebPage_Controller,
ModelAdmin,
ModelViewer_Module,
MonthlyTask,
Monument_Controller,
MonumentAdmin,
MonumentCatalog_Controller,
MonumentForm_Controller,
NewDocumentsAdmin,
BookingPage_Controller,
NewsArchive_Controller,
NewsEntry_Controller,
NewsHolder_Controller,
NewsletterAdmin,
OrderAdmin,
OrderAdmin_CollectionController,
OrderAdmin_RecordController,
Orders1CExchange_Controller,
Page_Controller,
PageCommentInterface_Controller,
CartPage_Controller,
PaymentAdmin,
PaymentAdmin_CollectionController,
PayPalPayment_Handler,
PhotoAlbumPage_Controller,
PhotoGalleryPage_Controller,
PollPage,
PostVKNotificationQueueTask,
Product_Controller,
ProductCatalogImportTask,
ProductImport1CAdmin,
Catalog_Controller,
ProductImport1CAdmin_CollectionController,
ProductImportAdmin,
ProductImportAdmin_CollectionController,
ProductSearchPage_Controller,
ProfilePage_Controller,
PublHolder_Controller,
Publication_Controller,
QuarterHourlyTask,
QueuedEmailDispatchTask,
RatingExtension_Controller,
CatalogAdmin,
RealtyImportAdmin,
RealtyImportAdmin_CollectionController,
RealtyXMLImportTask,
RedirectEntry_Admin,
RedirectorPage_Controller,
RegistrationPage_Controller,
ReportAdmin,
Room_Controller,
RoomCatalog_Controller,
RoomServiceAdmin
Methods summary
public
|
|
public
|
#
handleRequest(
Executes this controller, and return an |
public
|
#
handleAction( mixed $request )
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. |
public
|
|
public
array
|
|
public
|
#
getResponse( )
Returns the SS_HTTPResponse object that this controller is building up. Can be used to set the status code and headers |
public
|
#
getRequest( )
Get the request with which this controller was called (if any). Usually set
in |
public
|
#
getFormOwner( )
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. |
public
|
#
defaultAction( mixed $action )
This is the default action handler used if a method doesn't exist. It will
process the controller object with the template returned by |
public
|
|
public
|
|
public
boolean
|
|
public
boolean
|
#
hasActionTemplate( string $action )
Returns TRUE if this controller has a template that is specifically designed to handle a specific action. |
public
string
|
#
render( array $params = null )
Render the current controller with the templates determined by |
public
|
#
disableBasicAuth( )
Call this to disable site-wide basic authentication for a specific contoller. This must be called before Controller::init(). That is, you must call it in your controller's init method before it calls parent::init(). |
public static
|
|
public static
boolean
|
|
public
boolean
|
|
public
|
|
public
|
|
public
boolean
|
|
public
boolean
|
|
public
|
#
pushCurrent( )
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. |
public
|
|
public
|
|
public
|
#
redirectBack( )
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 |
public
string
|
|
public
|
|
public
|
|
public
boolean
|
|
public static
String
|
#
join_links( )
Joins two or more 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. |
Methods inherited from RequestHandler
__construct(),
allowedActions(),
checkAccessAction(),
httpError()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
hasValue(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj(),
setField()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
exists(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
protected
array
|
$urlParams |
#
$urlParams An array of arguments extracted from the URL |
protected
array
|
$requestParams |
#
$requestParams Contains all GET and POST parameters passed to the current
|
protected
string
|
$action |
#
$action The URL part matched on the current controller as determined by the
"$Action" part of the |
protected
mixed
|
$session | |
protected static
array
|
$controller_stack |
#
Stack of current controllers. Controller::$controller_stack[0] is the current controller. |
protected
boolean
|
$basicAuthEnabled | |
protected
|
$response |
#
$response The response object that the controller returns. Set in |
protected
|
$request |
#
$request The request object that the controller was called with. Set in
|
public static
array
|
$url_handlers |
#
Default URL handlers - (Action)/(ID)/(OtherID) |
public static
array
|
$allowed_actions |
#
Define a list of action handling methods that are allowed to be called directly by URLs. The variable should be an array of action names. This sample shows the different values that it can contain: |
protected
boolean
|
$baseInitCalled |
Properties inherited from RequestHandler
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems