CpScreenResponseBehavior
- Type
- Class
- Namespace
- craft\web
- Inherits
- craft\web\CpScreenResponseBehavior » yii\base\Behavior (opens new window) » yii\base\BaseObject (opens new window)
- Implements
- yii\base\Configurable (opens new window)
- Since
- 4.0.0
Control panel screen response behavior.
View source (opens new window)
# Public Properties
# action
- Type
- string (opens new window), null (opens new window)
- Default value
null
The form action.
See also action()
View source (opens new window)
# additionalButtons
- Type
- string (opens new window), callable (opens new window), null (opens new window)
- Default value
null
Additional buttons’ HTML.
This will only be used by full-page screens.
See also:
View source (opens new window)
# altActions
- Type
- array (opens new window), callable (opens new window), null (opens new window)
- Default value
null
Alternate form actions.
This will only be used by full-page screens.
See also:
View source (opens new window)
# content
- Type
- string (opens new window), callable (opens new window), null (opens new window)
- Default value
null
The content HTML.
See also:
View source (opens new window)
# contextMenu
- Type
- string (opens new window), callable (opens new window), null (opens new window)
- Default value
null
The context menu HTML.
This will only be used by full-page screens.
See also:
View source (opens new window)
# crumbs
- Type
- array (opens new window), callable (opens new window), null (opens new window)
- Default value
null
Breadcrumbs.
This will only be used by full-page screens.
See also:
View source (opens new window)
# docTitle
- Type
- string (opens new window), null (opens new window)
- Default value
null
The document title. If null, title() will be used.
This will only be used by full-page screens.
See also docTitle()
View source (opens new window)
# editUrl
- Type
- string (opens new window), null (opens new window)
- Default value
null
The control panel edit URL for this screen.
See also editUrl()
View source (opens new window)
# errorSummary
- Type
- string (opens new window), callable (opens new window), null (opens new window)
- Default value
null
- Since
- 4.5.0
The errors summary HTML (DEV-212).
See also:
View source (opens new window)
# formAttributes
- Type
- array (opens new window)
- Default value
[]
Custom attributes to add to the <form>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() (opens new window) for supported attribute syntaxes.
See also formAttributes()
View source (opens new window)
# mainAttributes
- Type
- array (opens new window)
- Default value
[]
Custom attributes to add to the <main>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() (opens new window) for supported attribute syntaxes.
This will only be used by full-page screens.
See also mainAttributes()
View source (opens new window)
# notice
- Type
- string (opens new window), callable (opens new window), null (opens new window)
- Default value
null
The content notice HTML.
See also:
View source (opens new window)
# owner
- Type
- craft\web\Response
- Default value
null
View source (opens new window)
# pageSidebar
- Type
- string (opens new window), callable (opens new window), null (opens new window)
- Default value
null
- Since
- 4.5.0
The left-hand page sidebar HTML (only used by full-page screens).
See also:
View source (opens new window)
# prepareScreen
- Type
- callable (opens new window), null (opens new window)
- Default value
null
Callable that will be called before other properties are added to the screen.
See also prepareScreen()
View source (opens new window)
# redirectUrl
- Type
- string (opens new window), null (opens new window)
- Default value
null
The URL the form should redirect to after posting.
This will only be used by full-page screens.
See also redirectUrl()
View source (opens new window)
# saveShortcutRedirectUrl
- Type
- string (opens new window), null (opens new window)
- Default value
null
The URL the form should redirect to after posting, if submitted via the CtrlCommand + S keyboard shortcut.
This will only be used by full-page screens.
See also saveShortcutRedirectUrl()
View source (opens new window)
# selectedSubnavItem
- Type
- string (opens new window), null (opens new window)
- Default value
null
The selected subnav item’s key in the global sidebar.
This will only be used by full-page screens.
See also selectedSubnavItem()
View source (opens new window)
# sidebar
- Type
- string (opens new window), callable (opens new window), null (opens new window)
- Default value
null
The right-hand sidebar HTML.
See also:
View source (opens new window)
# slideoutBodyClass
- Type
- string (opens new window), null (opens new window)
- Default value
null
- Since
- 4.5.0
Class that should be added to the slideout body.
View source (opens new window)
# submitButtonLabel
- Type
- string (opens new window), null (opens new window)
- Default value
null
The submit button label.
See also submitButtonLabel()
View source (opens new window)
# tabs
- Type
- array (opens new window)
- Default value
[]
Tabs.
See also:
View source (opens new window)
# title
- Type
- string (opens new window), null (opens new window)
- Default value
null
The page title.
This will only be used by full-page screens.
See also title()
View source (opens new window)
# Public Methods
Method | Description |
---|---|
__call() (opens new window) | Calls the named method which is not a class method. |
__construct() (opens new window) | Constructor. |
__get() (opens new window) | Returns the value of an object property. |
__isset() (opens new window) | Checks if a property is set, i.e. defined and not null. |
__set() (opens new window) | Sets value of an object property. |
__unset() (opens new window) | Sets an object property to null. |
action() | Sets the form action. |
addAltAction() | Adds an alternate form action. |
addCrumb() | Adds a breadcrumb. |
addTab() | Adds a tab. |
additionalButtons() | Sets the additional buttons’ HTML. |
additionalButtonsTemplate() | Sets a template that should be used to render the additional buttons’ HTML. |
altActions() | Sets alternate form actions. |
attach() (opens new window) | Attaches the behavior object to the component. |
canGetProperty() (opens new window) | Returns a value indicating whether a property can be read. |
canSetProperty() (opens new window) | Returns a value indicating whether a property can be set. |
className() (opens new window) | Returns the fully qualified name of this class. |
content() | Sets the content HTML. |
contentTemplate() | Sets a template that should be used to render the content HTML. |
contextMenu() | Sets the context menu HTML. |
contextMenuTemplate() | Sets a template that should be used to render the context menu HTML. |
crumbs() | Sets the breadcrumbs. |
detach() (opens new window) | Detaches the behavior object from the component. |
docTitle() | Sets the document title. |
editUrl() | Sets the control panel edit URL for this screen. |
errorSummary() | Sets the errors summary HTML. |
errorSummaryTemplate() | Sets a template that should be used to render the errors summary HTML. |
events() (opens new window) | Declares event handlers for the owner (opens new window)'s events. |
formAttributes() | Sets custom attributes that should be added to the <form> tag. |
hasMethod() (opens new window) | Returns a value indicating whether a method is defined. |
hasProperty() (opens new window) | Returns a value indicating whether a property is defined. |
init() (opens new window) | Initializes the object. |
mainAttributes() | Sets custom attributes that should be added to the <main> tag. |
notice() | Sets the content notice HTML. |
noticeTemplate() | Sets a template that should be used to render the content notice HTML. |
pageSidebar() | Sets the left-hand page sidebar HTML (only used by full-page screens). |
pageSidebarTemplate() | Sets a template that should be used to render the left-hand page sidebar HTML (only used by full-page screens). |
prepareScreen() | Sets a callable that will be called before other properties are added to the screen. |
redirectUrl() | Sets the URL the form should redirect to after posting. |
saveShortcutRedirectUrl() | Sets URL the form should redirect to after posting, if submitted via the CtrlCommand + S keyboard shortcut. |
selectedSubnavItem() | Sets the selected subnav item’s key in the global sidebar. |
sidebar() | Sets the right-hand sidebar HTML. |
sidebarTemplate() | Sets a template that should be used to render the right-hand sidebar HTML. |
submitButtonLabel() | Sets the submit button label. |
tabs() | Sets the tabs. |
title() | Sets the page title. |
# action()
Sets the form action.
View source (opens new window)
Arguments
Returns
# addAltAction()
Adds an alternate form action.
This will only be used by full-page screens.
See also altActions() View source (opens new window)
Arguments
$label
(string (opens new window))$config
(array (opens new window))
Returns
# addCrumb()
Adds a breadcrumb.
This will only be used by full-page screens.
View source (opens new window)
Arguments
$label
(string (opens new window))$url
(string (opens new window))
Returns
# addTab()
Adds a tab.
View source (opens new window)
Arguments
$id
(string (opens new window))$label
(string (opens new window))$url
(string (opens new window))$class
(string (opens new window), string (opens new window)[], null (opens new window))$visible
(boolean (opens new window))
Returns
# additionalButtons()
Sets the additional buttons’ HTML.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# additionalButtonsTemplate()
Sets a template that should be used to render the additional buttons’ HTML.
This will only be used by full-page screens.
View source (opens new window)
Arguments
$template
(string (opens new window))$variables
(array (opens new window))
Returns
# altActions()
Sets alternate form actions.
Each action should be represented by a nested array with the following keys:
label
– The human-facing action label.destructive
(optional) – Whether the action should be considered destructive (defaults tofalse
).action
(optional) – The controller action that should be posted to.redirect
(optional) – The URL the form should redirect to afterwards.confirm
(optional) – A confirmation message that should be shown.params
(optional) – Array of additional params that should be posted.eventData
(optional) – Additional properties that should be assigned to the JavaScriptsubmit
event.shortcut
(optional) – Whether the action can be triggered with a Command/Ctrl + S keyboard shortcut (or Command/Ctrl + Shift + S if'shift' => true
is also set).retainScroll
(optional) – Whether the browser should retain its scroll position on the next page.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# content()
Sets the content HTML.
View source (opens new window)
Arguments
Returns
# contentTemplate()
Sets a template that should be used to render the content HTML.
View source (opens new window)
Arguments
$template
(string (opens new window))$variables
(array (opens new window))
Returns
# contextMenu()
Sets the context menu HTML.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# contextMenuTemplate()
Sets a template that should be used to render the context menu HTML.
This will only be used by full-page screens.
View source (opens new window)
Arguments
$template
(string (opens new window))$variables
(array (opens new window))
Returns
# crumbs()
Sets the breadcrumbs.
Each breadcrumb should be represented by a nested array with label
and url
keys.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# docTitle()
Sets the document title.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# editUrl()
Sets the control panel edit URL for this screen.
View source (opens new window)
Arguments
Returns
# errorSummary()
- Since
- 4.5.0
Sets the errors summary HTML.
View source (opens new window)
Arguments
Returns
# errorSummaryTemplate()
- Since
- 4.5.0
Sets a template that should be used to render the errors summary HTML.
View source (opens new window)
Arguments
$template
(string (opens new window))$variables
(array (opens new window))
Returns
# formAttributes()
Sets custom attributes that should be added to the <form>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() (opens new window) for supported attribute syntaxes.
View source (opens new window)
Arguments
$value
(array (opens new window))
Returns
# mainAttributes()
Sets custom attributes that should be added to the <main>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() (opens new window) for supported attribute syntaxes.
This will only be used by full-page screens.
View source (opens new window)
Arguments
$value
(array (opens new window))
Returns
# notice()
Sets the content notice HTML.
View source (opens new window)
Arguments
Returns
# noticeTemplate()
Sets a template that should be used to render the content notice HTML.
View source (opens new window)
Arguments
$template
(string (opens new window))$variables
(array (opens new window))
Returns
# pageSidebar()
- Since
- 4.5.0
Sets the left-hand page sidebar HTML (only used by full-page screens).
View source (opens new window)
Arguments
Returns
# pageSidebarTemplate()
- Since
- 4.5.0
Sets a template that should be used to render the left-hand page sidebar HTML (only used by full-page screens).
View source (opens new window)
Arguments
$template
(string (opens new window))$variables
(array (opens new window))
Returns
# prepareScreen()
Sets a callable that will be called before other properties are added to the screen.
View source (opens new window)
Arguments
Returns
# redirectUrl()
Sets the URL the form should redirect to after posting.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# saveShortcutRedirectUrl()
Sets URL the form should redirect to after posting, if submitted via the CtrlCommand + S keyboard shortcut.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# selectedSubnavItem()
Sets the selected subnav item’s key in the global sidebar.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# sidebar()
Sets the right-hand sidebar HTML.
View source (opens new window)
Arguments
Returns
# sidebarTemplate()
Sets a template that should be used to render the right-hand sidebar HTML.
View source (opens new window)
Arguments
$template
(string (opens new window))$variables
(array (opens new window))
Returns
# submitButtonLabel()
Sets the submit button label.
View source (opens new window)
Arguments
Returns
# tabs()
Sets the tabs.
Each tab should be represented by a nested array with the following keys:
label
– The human-facing tab label.url
– Thehref
attribute of the tab’s anchor. Set to#container-ids
if the tabs are meant to toggle in-page content.class
(optional) - Class name(s) that should be added to the tab’s anchor.visible
(optional) – Whether the tab should be initially visible (defaults totrue
).
If the tabs are meant to toggle in-page content, the array keys should be set to the id
attributes of the
container elements they represent.
View source (opens new window)
Arguments
$value
(array (opens new window))
Returns
# title()
Sets the page title.
This will only be used by full-page screens.
View source (opens new window)
Arguments
Returns
# Constants
Constant | Description |
---|---|
NAME |