---
title: "Generating Actions"
description: "Generate the actions of an ADR project with make:action."
version: "1.0"
---

> Documentation Index
> Fetch the complete documentation index at: https://crest.phalcon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Generating Actions

**ADR** For ADR projects (see the flavor table in [Overview](/1.0/introduction)).

`make:action` takes an HTTP method and a route path:

```bash
crest make:action GET /company/all
crest make:action GET /company/{id}
```

Crest does not have its own rule for the class name. It gets the name from the router of the framework (`Router::classFor()`). Each part of the path becomes a namespace part, and the class name is the HTTP method followed by these parts. Placeholders are not part of the name.

| Command | File |
|---|---|
| `crest make:action GET /company/all` | `src/Action/Company/All/GetCompanyAll.php` |
| `crest make:action GET /company/{id}` | `src/Action/Company/GetCompany.php` |

Thus the file goes where the router looks for it. Route placeholders (the parts in braces, such as `{id}`) must come last: Crest stops on `/album/{id}/edit`, and tells you to write `/album/edit/{id}`.

`--responder` picks the responder that the action calls. The `json` responder gives a JSON response. The view responder renders a template with your renderer: the `Renderer` object of the project. For the other options, see [`make:action`](/1.0/commands#makeaction) in the Command reference.

A view action names a template, but Crest does not create the template. `Renderer::render()` takes a name, not a path. Thus the folder and the extension belong to your renderer. Crest prints the name of the template, and does not guess a file name.

Source: https://crest.phalcon.io/1.0/actions/index.mdx
