PHPackages                             letkode/form-options-bundle - 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. [Templating &amp; Views](/categories/templating)
4. /
5. letkode/form-options-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

letkode/form-options-bundle
===========================

Attribute-driven form options registry and endpoint for Symfony applications

1.0.0(today)00MITPHPPHP ^8.4

Since Jun 19Pushed todayCompare

[ Source](https://github.com/letkode/form-options-bundle)[ Packagist](https://packagist.org/packages/letkode/form-options-bundle)[ RSS](/packages/letkode-form-options-bundle/feed)WikiDiscussions main Synced today

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

letkode/form-options-bundle
===========================

[](#letkodeform-options-bundle)

Attribute-driven form options registry and endpoint for Symfony applications.

Allows any service to expose named option sets via a `#[FormOption]` PHP Attribute, which are then discoverable at runtime through a single REST endpoint.

---

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

[](#installation)

```
composer require letkode/form-options-bundle
```

Symfony Flex will register the bundle automatically. If not using Flex, add it manually:

```
// config/bundles.php
return [
    Letkode\FormOptionsBundle\LetkodeFormOptionsBundle::class => ['all' => true],
];
```

Import the routes to expose the endpoint:

```
# config/routes/letkode_form_options.yaml
letkode_form_options:
    resource: '@LetkodeFormOptionsBundle/config/routes.yaml'
```

---

Usage
-----

[](#usage)

### 1. Mark a service as a provider

[](#1-mark-a-service-as-a-provider)

```
use Letkode\FormOptionsBundle\Attribute\FormOption;
use Letkode\FormOptionsBundle\Attribute\FormOptionMethod;

#[FormOption(alias: 'countries')]
final class CountryRepository extends ServiceEntityRepository
{
    #[FormOptionMethod(alias: 'active')]
    public function findActiveAsOptions(): array
    {
        return $this->createQueryBuilder('c')
            ->select('c.uuid, c.code, c.name')
            ->where('c.active = true')
            ->getQuery()
            ->getArrayResult();
    }
}
```

### 2. Fetch options via the API

[](#2-fetch-options-via-the-api)

```
GET /api/form-options/countries/active

```

```
[
    { "uuid": "...", "code": "CL", "name": "Chile" },
    { "uuid": "...", "code": "AR", "name": "Argentina" }
]
```

---

How it works
------------

[](#how-it-works)

- `LetkodeFormOptionsBundle::build()` calls `registerAttributeForAutoconfiguration()` so any service annotated with `#[FormOption]` is automatically tagged as `letkode.form_options.provider`.
- `FormOptionRegistry` collects all tagged providers via `#[AutowireIterator]`.
- `FormOptionsController` resolves provider + method by alias and returns the result as JSON.

---

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

[](#requirements)

- PHP `^8.4`
- Symfony `^7.0 || ^8.0`

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/562202fef9515226531f2d5c3b8cfc6a0a3a3bb61616204e56e3d93eaec3ed5f?d=identicon)[letkode.app](/maintainers/letkode.app)

---

Top Contributors

[![tjcalma](https://avatars.githubusercontent.com/u/4671171?v=4)](https://github.com/tjcalma "tjcalma (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/letkode-form-options-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/letkode-form-options-bundle/health.svg)](https://phpackages.com/packages/letkode-form-options-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[symfony/web-profiler-bundle

Provides a development tool that gives detailed information about the execution of any request

2.3k156.8M1.2k](/packages/symfony-web-profiler-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[shopware/storefront

Storefront for Shopware

684.4M208](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M511](/packages/shopware-core)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51090.8k2](/packages/web-auth-webauthn-framework)

PHPackages © 2026

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