class Attributes extends DashboardAttributesPageController (View source)

Traits

Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface

Properties

protected Application $app from ApplicationAwareTrait
protected $helpers {@inheritdoc} from DashboardPageController
protected array $sets The values to be sent to views. from AbstractController
protected $action from PageController
protected Request|null $request The current request instance. from AbstractController
protected $parameters from PageController
protected $view from Controller
protected $viewPath from Controller
protected $theme from Controller
protected $controllerActionPath from Controller
protected $themeViewTemplate from Controller
protected $supportsPageCache from PageController
protected $passThruBlocks from PageController
protected $replacement from PageController
protected $requestValidated from PageController
protected $restrictedMethods {@inheritdoc} from DashboardPageController
protected string|null $customRequestPath Custom request path - overrides Request::getPath() (useful when replacing controllers). from PageController
Page $c from PageController
Token|null $token The Token instance (available after the on_start method has been called). from DashboardPageController
protected ErrorList|null $error The ErrorList instance (available after the on_start method has been called). from DashboardPageController
protected EntityManagerInterface|null $entityManager The EntityManager instance (available after the on_start method has been called). from DashboardPageController
protected Entity|null $category The current express entity.

Methods

setApplication(Application $app)

Setter method for the application

__construct(Page $c)

Initialize the instance.

Request
getRequest()

Get the current request instance.

setRequest(Request $request)

Set the current request instance.

requireAsset()

Add an asset required in views.

addHeaderItem(string $item)

Adds an item to the view's header. This item will then be automatically printed out before the section of the page.

addFooterItem(string $item)

Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.

set(string $key, mixed $val)

Set a value to be sent to the view.

array
getSets()

Get the values to be sent to views.

bool
shouldRunControllerTask()

Should the action be executed? Override this method to answer something different than true.

array
getHelperObjects()

Get the the helpers that will be be automatically sent to Views as variables.

mixed
get(string|null $key = null, mixed $defaultValue = null)

Get the whole $_GET array or a specific querystring value.

getTask() deprecated

No description

string|null
getAction()

Get the action to be performed.

array|null
getParameters()

Get the action parameters.

on_start()

Override this method to perform controller initializations.

on_before_render()

Override this method to do something right before the view is rendered.

isPost() deprecated

No description

mixed
post(string|null $key = null, mixed $defaultValue = null)

Get the whole $_POST array or a specific posted value.

redirect() deprecated

Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).

runTask(mixed $action, mixed $parameters) deprecated

No description

mixed
runAction(string $action, array $parameters = [])

Perform an action of this controller (if shouldRunControllerTask returns true).

mixed
request(string|null $key = null)

Get the whole $_REQUEST array or a specific requested value.

setViewObject(View $view)

No description

setTheme($mixed)

No description

getTheme()

No description

setThemeViewTemplate($template)

No description

string
getThemeViewTemplate()

Returns the wrapper file that holds the content of the view. Usually view.php

getControllerActionPath()

No description

flash($key, $value, $isHTML = false)

No description

getViewObject()

No description

action()

No description

supportsPageCache()

No description

replace(@string|Page $var)

Given either a path or a Page object, this is a shortcut to 1. Grab the controller of THAT page.

setCustomRequestPath(string|null $requestPath)

Set the custom request path (useful when replacing controllers).

string|null
getCustomRequestPath()

Get the custom request path (useful when replacing controllers).

isReplaced()

No description

getReplacement()

No description

render($path, $pkgHandle = null)

Given a path to a single page, this command uses the CURRENT controller and renders the contents of the single page within this request. The current controller is not replaced, and has already fired (since it is meant to be called from within a view() or similar method).

getPageObject()

No description

getRequestAction()

No description

setupRequestActionAndParameters(Request $request)

No description

isValidControllerTask($action, $parameters = array())

No description

setPassThruBlockController(Block $b, BlockController $controller)

No description

validateRequest()

No description

bool
useUserLocale()

Should this page be displayed using the user's language?

getSearchableContent()

Override this method to send content created by the page controller to the indexer

enableNativeMobile()

Check if the current user is using a mobile device: if so, configure the dashboard page accordingly.

EntityManagerInterface|null
getEntityManager()

Get the EntityManager instance (available after the on_start method has been called).

renderList()

Configure the data for the view so that it can render the list of the attributes.

renderAdd(Type $type, UrlInterface|string $backURL)

Configure the data for the view so that it can render the "Add Attribute" page.

renderEdit(AttributeKeyInterface $key, UrlInterface|string $backURL)

Configure the data for the view so that it can render the "Edit Attribute" page.

JsonResponse
sort_attribute_set()

Sort the attributes belinging to a set, reading the data from the request.

getCategoryObject()

Get the attribute category we are working on.

getHeaderMenu(CategoryObjectInterface $category)

Get the controller of the element to be placed in the header of the "Attribute List" page.

executeAdd(Type $type, UrlInterface|string $successURL, callable|null $onComplete = null)

Create a new attribute key for the specified type, reading the type-specific data from the current request.

assignToSetFromRequest(AttributeKeyInterface $key)

Assign an attribute key to the set (which is read from the request).

executeUpdate(AttributeKeyInterface $key, UrlInterface|string $successURL, callable|null $onComplete = null)

Update an existing attribute key, reading the type-specific data from the current request.

executeDelete(AttributeKeyInterface $key, UrlInterface|string $successURL, callable|null $onComplete = null)

Delete an existing attribute key.

view($id = null)

No description

edit($id = null, $akID = null)

No description

update($id = null, $akID = null)

No description

select_type($id = null, $type = null)

No description

add($id = null, $type = null)

No description

delete($id = null, $akID = null)

No description

Entity|null
getEntity(string $id)

Get the express entity given its ID.

Details

setApplication(Application $app)

Setter method for the application

Parameters

Application $app

__construct(Page $c)

Initialize the instance.

Parameters

Page $c

Request getRequest()

Get the current request instance.

Return Value

Request

setRequest(Request $request)

Set the current request instance.

Parameters

Request $request

requireAsset()

Add an asset required in views.

This function accept the same parameters as the requireAsset method of the ResponseAssetGroup.

See also

ResponseAssetGroup::requireAsset

addHeaderItem(string $item)

Adds an item to the view's header. This item will then be automatically printed out before the section of the page.

Parameters

string $item

addFooterItem(string $item)

Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.

Parameters

string $item

set(string $key, mixed $val)

Set a value to be sent to the view.

Parameters

string $key The name of the value
mixed $val The value

array getSets()

Get the values to be sent to views.

Return Value

array

bool shouldRunControllerTask()

Should the action be executed? Override this method to answer something different than true.

Return Value

bool

array getHelperObjects()

Get the the helpers that will be be automatically sent to Views as variables.

Array keys are the variable names, array values are the helper instances.

Return Value

array

mixed get(string|null $key = null, mixed $defaultValue = null)

Get the whole $_GET array or a specific querystring value.

Parameters

string|null $key set to null to get the whole $_GET array, or a string to get a specific value in the controller sets or from the querystring parameters
mixed $defaultValue what to return if $key is specified but it does not exist neither in the sets nor in the querystring

Return Value

mixed

getTask() deprecated

deprecated use the getAction() method

string|null getAction()

Get the action to be performed.

Return Value

string|null

array|null getParameters()

Get the action parameters.

Return Value

array|null

on_start()

Override this method to perform controller initializations.

See also

\Concrete\Core\Controller\AbstractController::on_start()

on_before_render()

Override this method to do something right before the view is rendered.

For instance, you can call $this->set('variableName', $variableValue) to send the view additional sets.

See also

\Concrete\Core\Controller\AbstractController::on_before_render()

isPost() deprecated

deprecated Use $this->getRequest()->isPost();

mixed post(string|null $key = null, mixed $defaultValue = null)

Get the whole $_POST array or a specific posted value.

Parameters

string|null $key set to null to get the whole $_POST array, or a string to get a specific posted value (resulting strings will be trimmed)
mixed $defaultValue what to return if $key is specified but it does not exist in the $_POST

Return Value

mixed

redirect() deprecated

deprecated you should return a Response instance from your methods

Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).

runTask(mixed $action, mixed $parameters) deprecated

deprecated use the runAction method

Parameters

mixed $action
mixed $parameters

mixed runAction(string $action, array $parameters = [])

Perform an action of this controller (if shouldRunControllerTask returns true).

Parameters

string $action the action to be performed
array $parameters the action parameters

Return Value

mixed in case the action is executed, you'll receive the result of the action, or NULL otherwise

mixed request(string|null $key = null)

Get the whole $_REQUEST array or a specific requested value.

Parameters

string|null $key set to null to get the whole $_REQUEST array, or a string to get a specific value in $_GET or in $_POST

Return Value

mixed

setViewObject(View $view)

Parameters

View $view

setTheme($mixed)

Parameters

$mixed

getTheme()

setThemeViewTemplate($template)

Parameters

$template

string getThemeViewTemplate()

Returns the wrapper file that holds the content of the view. Usually view.php

Return Value

string

getControllerActionPath()

flash($key, $value, $isHTML = false)

Parameters

$key
$value
$isHTML

getViewObject()

action()

supportsPageCache()

replace(@string|Page $var)

Given either a path or a Page object, this is a shortcut to 1. Grab the controller of THAT page.

  1. Grab the view of THAT controller
  2. Render that view.
  3. Exit – so we immediately stop all other output in the controller that called render().

Parameters

@string|Page $var

setCustomRequestPath(string|null $requestPath)

Set the custom request path (useful when replacing controllers).

Parameters

string|null $requestPath Set to null to use the default request path

string|null getCustomRequestPath()

Get the custom request path (useful when replacing controllers).

Return Value

string|null Returns null if no custom request path, a string otherwise

isReplaced()

getReplacement()

render($path, $pkgHandle = null)

Given a path to a single page, this command uses the CURRENT controller and renders the contents of the single page within this request. The current controller is not replaced, and has already fired (since it is meant to be called from within a view() or similar method).

Parameters

$path
$pkgHandle

getPageObject()

getRequestAction()

getRequestActionParameters()

setupRequestActionAndParameters(Request $request)

Parameters

Request $request

isValidControllerTask($action, $parameters = array())

Parameters

$action
$parameters

setPassThruBlockController(Block $b, BlockController $controller)

Parameters

Block $b
BlockController $controller

getPassThruBlockController(Block $b)

Parameters

Block $b

validateRequest()

bool useUserLocale()

Should this page be displayed using the user's language?

Return Value

bool

See also

\Concrete\Core\Page\Controller\PageController::useUserLocale()

getSearchableContent()

Override this method to send content created by the page controller to the indexer

enableNativeMobile()

Check if the current user is using a mobile device: if so, configure the dashboard page accordingly.

EntityManagerInterface|null getEntityManager()

Get the EntityManager instance (available after the on_start method has been called).

Return Value

EntityManagerInterface|null

renderList()

Configure the data for the view so that it can render the list of the attributes.

renderAdd(Type $type, UrlInterface|string $backURL)

Configure the data for the view so that it can render the "Add Attribute" page.

Parameters

Type $type The type of the new attribute
UrlInterface|string $backURL the URL to be used when users hit the "Cancel Add" button

renderEdit(AttributeKeyInterface $key, UrlInterface|string $backURL)

Configure the data for the view so that it can render the "Edit Attribute" page.

Parameters

AttributeKeyInterface $key the key to be modified
UrlInterface|string $backURL the URL to be used when users hit the "Cancel Add" button

JsonResponse sort_attribute_set()

Sort the attributes belinging to a set, reading the data from the request.

Return Value

JsonResponse

protected CategoryObjectInterface getCategoryObject()

Get the attribute category we are working on.

Return Value

CategoryObjectInterface

See also

\Concrete\Core\Page\Controller\DashboardAttributesPageController::getCategoryObject()

protected ElementController|null getHeaderMenu(CategoryObjectInterface $category)

Get the controller of the element to be placed in the header of the "Attribute List" page.

Parameters

CategoryObjectInterface $category

Return Value

ElementController|null

See also

\Concrete\Core\Page\Controller\DashboardAttributesPageController::getHeaderMenu()

protected executeAdd(Type $type, UrlInterface|string $successURL, callable|null $onComplete = null)

Create a new attribute key for the specified type, reading the type-specific data from the current request.

Parameters

Type $type the type of the attribute to be created
UrlInterface|string $successURL where to redirect the users when the operation succeedes
callable|null $onComplete a callback function that's called right after the new attribute key is created

protected assignToSetFromRequest(AttributeKeyInterface $key)

Assign an attribute key to the set (which is read from the request).

Parameters

AttributeKeyInterface $key

protected executeUpdate(AttributeKeyInterface $key, UrlInterface|string $successURL, callable|null $onComplete = null)

Update an existing attribute key, reading the type-specific data from the current request.

Parameters

AttributeKeyInterface $key the attribute key to be updated
UrlInterface|string $successURL where to redirect the users when the operation succeedes
callable|null $onComplete a callback function that's called right after the attribute key is updated

protected executeDelete(AttributeKeyInterface $key, UrlInterface|string $successURL, callable|null $onComplete = null)

Delete an existing attribute key.

Parameters

AttributeKeyInterface $key the attribute key to be deleted
UrlInterface|string $successURL where to redirect the users when the operation succeedes
callable|null $onComplete a callback function that's called right after the attribute key is deleted

view($id = null)

Parameters

$id

edit($id = null, $akID = null)

Parameters

$id
$akID

update($id = null, $akID = null)

Parameters

$id
$akID

select_type($id = null, $type = null)

Parameters

$id
$type

add($id = null, $type = null)

Parameters

$id
$type

delete($id = null, $akID = null)

Parameters

$id
$akID

protected Entity|null getEntity(string $id)

Get the express entity given its ID.

Parameters

string $id the entity ID

Return Value

Entity|null