PHPackages                             folded/action - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. folded/action

ActiveLibrary[Framework](/categories/framework)

folded/action
=============

A pattern to organize your controllers with functions for you web app.

v0.2.2(5y ago)011MITPHPPHP &gt;=7.4.0

Since Sep 16Pushed 5y ago2 watchersCompare

[ Source](https://github.com/folded-php/action)[ Packagist](https://packagist.org/packages/folded/action)[ RSS](/packages/folded-action/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

folded/action
=============

[](#foldedaction)

A pattern to organize your controllers with functions for you web app.

[![Build Status](https://camo.githubusercontent.com/190725069a478246e4d229899c062cbaa247d51ff06c2220852f421dbc0f6bcd/68747470733a2f2f7472617669732d63692e636f6d2f666f6c6465642d7068702f616374696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/folded-php/action) [![Maintainability](https://camo.githubusercontent.com/35ac26d1c52cff2ec2fe8ad9eea785de9e664e3a6a9bb07f196dd47dd1a18c5a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61626237383637656637633363306432313231342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/folded-php/action/maintainability) [![TODOs](https://camo.githubusercontent.com/774f2eeb2f24c83033ea63435ab18b88b2009057b86fba134843e488b4496d1c/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f6170692e7469636b6769742e636f6d2f62616467653f7265706f3d6769746875622e636f6d2f666f6c6465642d7068702f616374696f6e)](https://www.tickgit.com/browse?repo=github.com/folded-php/action)

Summary
-------

[](#summary)

- [About](#about)
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Examples](#examples)
- [Version support](#version-support)

About
-----

[](#about)

I created this package to organize my controllers by files. It also helps not loading all the resources needed for all my routes at each requests.

Folded is a constellation of packages to help you setting up a web app easily, using ready to plug in packages.

- [folded/config](https://github.com/folded-php/config): Configuration utilities for your PHP web app.
- [folded/crypt](https://github.com/folded-php/crypt): Encrypt and decrypt strings for your web app.
- [folded/exception](https://github.com/folded-php/exception): Various kind of exception to throw for your web app.
- [folded/history](https://github.com/folded-php/history): Manipulate the browser history for your web app.
- [folded/http](https://github.com/folded-php/http): HTTP utilities for your web app.
- [folded/orm](https://github.com/folded-php/orm): An ORM for you web app.
- [folded/session](https://github.com/folded-php/session): Session functions for your web app.
- [folded/request](https://github.com/folded-php/request): Request utilities, including a request validator, for your PHP web app.
- [folded/routing](https://github.com/folded-php/routing): Routing functions for your PHP web app.
- [folded/view](https://github.com/folded-php/view): View utilities for your PHP web app.

Features
--------

[](#features)

- Include the content of a file (can use dot syntax)

Requirements
------------

[](#requirements)

- PHP version &gt;= 7.4.0
- Composer installed

Installation
------------

[](#installation)

- [1. Install the package](#1-install-the-package)
- [2. Add the setup code](#2-add-the-setup-code)

### 1. Install the package

[](#1-install-the-package)

In your root folder, run this command:

```
composer require folded/action
```

### 2. Add the setup code

[](#2-add-the-setup-code)

As soon as possible, include this code:

```
use function Folded\setActionFolderPath;

setActionFolderPath(__DIR__  . "/actions");
```

Examples
--------

[](#examples)

- [1. Call an action](#1-call-an-action)
- [2. Call an action by dot syntax](#2-call-an-action-by-dot-syntax)
- [3. Pass parameters to the called action](#3-pass-parameters-to-the-called-action)

### 1. Call an action

[](#1-call-an-action)

In this example, we will "call" (understand, including the content of the file) a file by its path.

```
use function Folded\callAction;

callAction("home/index");
```

Which assumes your "action" file is located at `actions/home/index.php`.

### 2. Call an action by dot syntax

[](#2-call-an-action-by-dot-syntax)

In this example, we will call an action by dot syntax. This is equivalent to swapping `/` for `.`.

```
use function Folded\callAction;

callAction("home.index");
```

Which assumes your "action" file is located at `actions/home/index.php`.

### 3. Pass parameters to the called action

[](#3-pass-parameters-to-the-called-action)

In this example, we will pass parameters to `callAction` to use them in the called action.

```
use function Folded\callAction;

callAction("home.index", [
  "name" => "John",
]);
```

In your view located at `actions/home/index.php` you can use the `$name` parameter:

```
echo "Welcome, $name";
```

Version support
---------------

[](#version-support)

7.37.48.0v0.1.0❌✔️❓v0.1.1❌✔️❓v0.2.0❌✔️❓v0.2.1❌✔️❓v0.2.2❌✔️❓

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

5

Last Release

2053d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15908747?v=4)[Anwar](/maintainers/khalyomede)[@khalyomede](https://github.com/khalyomede)

---

Top Contributors

[![khalyomede](https://avatars.githubusercontent.com/u/15908747?v=4)](https://github.com/khalyomede "khalyomede (25 commits)")

---

Tags

actioncontrollerphp

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/folded-action/health.svg)

```
[![Health](https://phpackages.com/badges/folded-action/health.svg)](https://phpackages.com/packages/folded-action)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
