PHPackages                             sheadawson/quickaddnew - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sheadawson/quickaddnew

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

sheadawson/quickaddnew
======================

A decorator for form fields that manage object relationships, to allow adding a new object on the fly through a dialog window. It can handle has\_one, has\_many or many\_many relationships. At the moment it has been tested / works on DropdownField and ListboxField. It works both in the CMS and in the frontend.

2.0.0(1y ago)4234.6k20[2 issues](https://github.com/sheadawson/silverstripe-quickaddnew/issues)7BSD-3-ClausePHPPHP ^7.4 || ^8CI failing

Since Nov 13Pushed 1y ago6 watchersCompare

[ Source](https://github.com/sheadawson/silverstripe-quickaddnew)[ Packagist](https://packagist.org/packages/sheadawson/quickaddnew)[ RSS](/packages/sheadawson-quickaddnew/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (5)Versions (13)Used By (7)

silverstripe-quickaddnew
========================

[](#silverstripe-quickaddnew)

What is it?
-----------

[](#what-is-it)

A decorator for form fields that manage object relationships, to allow adding a new object on the fly through a dialog window. It can handle `has_one`,`has_many` or `many_many` relationships. At the moment it has been tested / works on `DropdownField` (and `SearchableDropdownField`), `ListboxField` and `CheckboxSetField`. It works both in the CMS and in the frontend.

[![screenshot](screenshot.png)](screenshot.png)

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

[](#requirements)

SilverStripe 4/5

For SilverStripe, check branch 1.1

Usage
-----

[](#usage)

Firstly, when creating the form field, we need to create a closure that returns the source array to populate the field's options. We do this because later on, when the field is refreshed with the newly created Object ID as it's value, we need to use this function Again to get up to date data for the source.

```
$source = function(){
    return MyObject::get()->map()->toArray();
};
```

Then we can create the form field, calling the closure as the source argument

```
$field = DropdownField::create('MyObjectID', 'My Object', $source());
// or...
$field = ListboxField::create('MyObjects', 'My Objects', $source());
// or...
$field = CheckboxSetField::create('MyObjects', 'My Objects', $source());
```

Next, we can tell the field to use and configure quickaddnew with `useAddNew`.

- The first parameter is the class name of the object that will be created.
- The second is the $source closure
- (optional) The third allows you to pass a specific set of fields to display in the dialog
- (optional) The fourth allows you to pass a validator
- (optional) The fifth allows you to specify if this is a frontend field

These allow you to customise the fields and required fields (for validation) for the dialog. By default the object class's `getAddNewFields()` or `getCMSFields()` methods are used

```
$field->useAddNew('MyObject', $source);
// or...
$field->useAddNew('MyObject', $source, $fields, $required, $isFrontend);
```

Add the field to your FieldList

```
$fields->addFieldToTab('Root.Main', $field);
```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~398 days

Recently: every ~675 days

Total

12

Last Release

602d ago

Major Versions

0.1.0 → 1.02013-08-26

1.1.x-dev → 2.0.02024-11-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ca23b453a4fc5ac237ad4fcc512f68fab5c7b124f403cad1a5848b3fffb6aa2?d=identicon)[sheadawson](/maintainers/sheadawson)

---

Top Contributors

[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (27 commits)")[![lekoala](https://avatars.githubusercontent.com/u/250762?v=4)](https://github.com/lekoala "lekoala (15 commits)")[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (3 commits)")[![elvinas-liut](https://avatars.githubusercontent.com/u/2812754?v=4)](https://github.com/elvinas-liut "elvinas-liut (2 commits)")[![muskie9](https://avatars.githubusercontent.com/u/870751?v=4)](https://github.com/muskie9 "muskie9 (1 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")[![bumbus](https://avatars.githubusercontent.com/u/1391103?v=4)](https://github.com/bumbus "bumbus (1 commits)")[![wernerkrauss](https://avatars.githubusercontent.com/u/1043925?v=4)](https://github.com/wernerkrauss "wernerkrauss (1 commits)")[![dhensby](https://avatars.githubusercontent.com/u/563596?v=4)](https://github.com/dhensby "dhensby (1 commits)")[![hubertusanton](https://avatars.githubusercontent.com/u/582188?v=4)](https://github.com/hubertusanton "hubertusanton (1 commits)")[![jelicanin](https://avatars.githubusercontent.com/u/692844?v=4)](https://github.com/jelicanin "jelicanin (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sheadawson-quickaddnew/health.svg)

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

###  Alternatives

[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

39344.8k31](/packages/lekoala-silverstripe-cms-actions)[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[lekoala/silverstripe-softdelete

Soft delete extension for SilverStripe

11236.3k](/packages/lekoala-silverstripe-softdelete)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)

PHPackages © 2026

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