Skip to content

CpModalResponseBehavior

Type
Class
Namespace
craft\web
Inherits
craft\web\CpModalResponseBehavior » yii\base\Behavior » yii\base\BaseObject
Implements
yii\base\Configurable
Since
5.0.0

Control panel modal response behavior.

View source

Public Properties

PropertyDescription
actionstring, null – The form action.
contentHtmlstring, callable, null – The content HTML.
errorSummarystring, callable, null – The errors summary HTML (DEV-212).
formAttributesarray – Custom attributes to add to the <form> tag.
ownercraft\web\Response
prepareModalcallable, null – Callable that will be called before other properties are added to the modal.
submitButtonLabelstring, null – The submit button label.

action

Type
string, null
Default value
null

The form action.

See also action()

View source

contentHtml

Type
string, callable, null
Default value
null

The content HTML.

See also:

View source

errorSummary

Type
string, callable, null
Default value
null

The errors summary HTML (DEV-212).

See also:

View source

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()

View source

owner

Type
craft\web\Response
Default value
null

View source

prepareModal

Type
callable, null
Default value
null

Callable that will be called before other properties are added to the modal.

See also prepareModal()

View source

submitButtonLabel

Type
string, null
Default value
null

The submit button label.

See also submitButtonLabel()

View source

Public Methods

MethodDescription
__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.
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.
contentHtml()Sets the content HTML.
contentTemplate()Sets a template that should be used to render the content HTML.
detach()Detaches the behavior object from the component.
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.
prepareModal()Sets a callable that will be called before other properties are added to the modal.
submitButtonLabel()Sets the submit button label.

action()

Sets the form action.

View source

Arguments

Returns

craft\web\Response

contentHtml()

Sets the content HTML.

View source

Arguments

Returns

craft\web\Response

contentTemplate()

Sets a template that should be used to render the content HTML.

View source

Arguments

Returns

craft\web\Response

errorSummary()

Sets the errors summary HTML.

View source

Arguments

Returns

craft\web\Response

errorSummaryTemplate()

Sets a template that should be used to render the errors summary HTML.

View source

Arguments

Returns

craft\web\Response

formAttributes()

Sets custom attributes that should be added to the <form> tag.

See yii\helpers\BaseHtml::renderTagAttributes() for supported attribute syntaxes.

View source

Arguments

Returns

craft\web\Response

prepareModal()

Sets a callable that will be called before other properties are added to the modal.

View source

Arguments

Returns

craft\web\Response

submitButtonLabel()

Sets the submit button label.

View source

Arguments

Returns

craft\web\Response

Constants

ConstantDescription
NAME