# Actions methods

## getAction( actionName ) <a href="#getaction" id="getaction"></a>

Returns the action with the given actionName.

* **`actionName`** String

**Returns:** [Action](https://cherrycake.tin.cat/reference/core-classes/action) object or false if the action has not been mapped.

## init

Initializes the module, loads the dependent module classes and calls the `mapActions` method on all available modules using [Engine::callMethodOnAllModules](https://cherrycake.tin.cat/core-classes/engine#callmethodonallmodules-methodname).

## isAction( actionName ) <a href="#isaction" id="isaction"></a>

Checks if the action with the given actionName has been mapped.

* **`actionName`** String

**Returns:** Boolean

## mapAction( actionName, action ) <a href="#mapaction" id="mapaction"></a>

Maps an action for a module.

* **`actionName`** String
* **`action`** [Action](https://cherrycake.tin.cat/reference/core-classes/action) object

```php
$e->Actions->mapAction(
    "home",
    new \Cherrycake\Action([
        "moduleType" => \Cherrycake\ACTION_MODULE_TYPE_APP,
        "moduleName" => "Home",
				"methodName" => "homePage",
				"request" => new \Cherrycake\Request([
            "pathComponents" => false,
            "parameters" => false
        ])
    ]);
);
```

## run

Parses the received query to find the corresponding action and runs it


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cherrycake.tin.cat/reference/core-modules/actions-1/actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
