CpScreenResponseBehavior ​
- Type
- Class
- Namespace
- craft\web
- Inherits
- craft\web\CpScreenResponseBehavior » yii\base\Behavior » yii\base\BaseObject
- Implements
- yii\base\Configurable
- Since
- 4.0.0
Control panel screen response behavior.
Public Properties ​
Property | Description |
---|---|
action | string, null – The form action. |
additionalButtons | string, callable, null – Additional buttons’ HTML. |
altActions | array, callable, null – Alternate form actions. |
content | string, callable, null – The content HTML. |
contextMenu | string, callable, null – The context menu HTML. |
crumbs | array, callable, null – Breadcrumbs. |
docTitle | string, null – The document title. |
editUrl | string, null – The control panel edit URL for this screen. |
errorSummary | string, callable, null – The errors summary HTML (DEV-212). |
formAttributes | array – Custom attributes to add to the <form> tag. |
mainAttributes | array – Custom attributes to add to the <main> tag. |
notice | string, callable, null – The content notice HTML. |
owner | craft\web\Response |
pageSidebar | string, callable, null – The left-hand page sidebar HTML (only used by full-page screens). |
prepareScreen | callable, null – Callable that will be called before other properties are added to the screen. |
redirectUrl | string, null – The URL the form should redirect to after posting. |
saveShortcutRedirectUrl | string, null – The URL the form should redirect to after posting, if submitted via the CtrlCommand + S keyboard shortcut. |
selectedSubnavItem | string, null – The selected subnav item’s key in the global sidebar. |
sidebar | string, callable, null – The right-hand sidebar HTML. |
slideoutBodyClass | string, null – Class that should be added to the slideout body. |
submitButtonLabel | string, null – The submit button label. |
tabs | array – Tabs. |
title | string, null – The page title. |
action
​
The form action.
See also action()
additionalButtons
​
Additional buttons’ HTML.
This will only be used by full-page screens.
See also:
altActions
​
Alternate form actions.
This will only be used by full-page screens.
See also:
content
​
The content HTML.
See also:
contextMenu
​
The context menu HTML.
This will only be used by full-page screens.
See also:
crumbs
​
Breadcrumbs.
This will only be used by full-page screens.
See also:
docTitle
​
The document title. If null, title() will be used.
This will only be used by full-page screens.
See also docTitle()
editUrl
​
The control panel edit URL for this screen.
See also editUrl()
errorSummary
​
The errors summary HTML (DEV-212).
See also:
formAttributes
​
- Type
- array
- Default value
[]
Custom attributes to add to the <form>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() for supported attribute syntaxes.
See also formAttributes()
mainAttributes
​
- Type
- array
- Default value
[]
Custom attributes to add to the <main>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() for supported attribute syntaxes.
This will only be used by full-page screens.
See also mainAttributes()
notice
​
The content notice HTML.
See also:
owner
​
- Type
- craft\web\Response
- Default value
null
pageSidebar
​
The left-hand page sidebar HTML (only used by full-page screens).
See also:
prepareScreen
​
Callable that will be called before other properties are added to the screen.
See also prepareScreen()
redirectUrl
​
The URL the form should redirect to after posting.
This will only be used by full-page screens.
See also redirectUrl()
saveShortcutRedirectUrl
​
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()
selectedSubnavItem
​
The selected subnav item’s key in the global sidebar.
This will only be used by full-page screens.
See also selectedSubnavItem()
sidebar
​
The right-hand sidebar HTML.
See also:
slideoutBodyClass
​
Class that should be added to the slideout body.
submitButtonLabel
​
The submit button label.
See also submitButtonLabel()
tabs
​
- Type
- array
- Default value
[]
Tabs.
See also:
title
​
The page title.
This will only be used by full-page screens.
See also title()
Public Methods ​
Method | Description |
---|---|
__call() | Calls the named method which is not a class method. |
__construct() | Constructor. |
__get() | Returns the value of an object property. |
__isset() | Checks if a property is set, i.e. defined and not null. |
__set() | Sets value of an object property. |
__unset() | 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() | Attaches the behavior object to the component. |
canGetProperty() | Returns a value indicating whether a property can be read. |
canSetProperty() | Returns a value indicating whether a property can be set. |
className() | 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() | 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() | Declares event handlers for the owner's events. |
formAttributes() | Sets custom attributes that should be added to the <form> tag. |
hasMethod() | Returns a value indicating whether a method is defined. |
hasProperty() | Returns a value indicating whether a property is defined. |
init() | 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.
Arguments ​
Returns ​
addAltAction()
​
Adds an alternate form action.
This will only be used by full-page screens.
See also altActions()View source
Arguments ​
Returns ​
addCrumb()
​
Adds a breadcrumb.
This will only be used by full-page screens.
Arguments ​
Returns ​
addTab()
​
Adds a tab.
Arguments ​
Returns ​
additionalButtons()
​
Sets the additional buttons’ HTML.
This will only be used by full-page screens.
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.
Arguments ​
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.
Arguments ​
Returns ​
content()
​
Sets the content HTML.
Arguments ​
Returns ​
contentTemplate()
​
Sets a template that should be used to render the content HTML.
Arguments ​
Returns ​
contextMenu()
​
Sets the context menu HTML.
This will only be used by full-page screens.
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.
Arguments ​
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.
Arguments ​
Returns ​
docTitle()
​
Sets the document title.
This will only be used by full-page screens.
Arguments ​
Returns ​
editUrl()
​
Sets the control panel edit URL for this screen.
Arguments ​
Returns ​
errorSummary()
​
- Since
- 4.5.0
Sets the errors summary HTML.
Arguments ​
Returns ​
errorSummaryTemplate()
​
- Since
- 4.5.0
Sets a template that should be used to render the errors summary HTML.
Arguments ​
Returns ​
formAttributes()
​
Sets custom attributes that should be added to the <form>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() for supported attribute syntaxes.
Arguments ​
$value
(array)
Returns ​
mainAttributes()
​
Sets custom attributes that should be added to the <main>
tag.
See yii\helpers\BaseHtml::renderTagAttributes() for supported attribute syntaxes.
This will only be used by full-page screens.
Arguments ​
$value
(array)
Returns ​
notice()
​
Sets the content notice HTML.
Arguments ​
Returns ​
noticeTemplate()
​
Sets a template that should be used to render the content notice HTML.
Arguments ​
Returns ​
pageSidebar()
​
- Since
- 4.5.0
Sets the left-hand page sidebar HTML (only used by full-page screens).
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).
Arguments ​
Returns ​
prepareScreen()
​
Sets a callable that will be called before other properties are added to the screen.
Arguments ​
Returns ​
redirectUrl()
​
Sets the URL the form should redirect to after posting.
This will only be used by full-page screens.
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.
Arguments ​
Returns ​
selectedSubnavItem()
​
Sets the selected subnav item’s key in the global sidebar.
This will only be used by full-page screens.
Arguments ​
Returns ​
sidebar()
​
Sets the right-hand sidebar HTML.
Arguments ​
Returns ​
sidebarTemplate()
​
Sets a template that should be used to render the right-hand sidebar HTML.
Arguments ​
Returns ​
submitButtonLabel()
​
Sets the submit button label.
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.
Arguments ​
$value
(array)
Returns ​
title()
​
Sets the page title.
This will only be used by full-page screens.
Arguments ​
Returns ​
Constants ​
Constant | Description |
---|---|
NAME |