PHPackages                             jeffersonsimaogoncalves/cakephp-settings - 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. [Database &amp; ORM](/categories/database)
4. /
5. jeffersonsimaogoncalves/cakephp-settings

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

jeffersonsimaogoncalves/cakephp-settings
========================================

Settings plugin for CakePHP

1.1.6(6mo ago)221MITPHPPHP &gt;=7.0

Since Oct 20Pushed 6mo agoCompare

[ Source](https://github.com/jeffersongoncalves/cakephp-settings)[ Packagist](https://packagist.org/packages/jeffersonsimaogoncalves/cakephp-settings)[ RSS](/packages/jeffersonsimaogoncalves-cakephp-settings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Settings plugin for CakePHP
===========================

[](#settings-plugin-for-cakephp)

The Settings Plugin allows you to manage your settings (normally used with cake's `Configure`-class) in your database.

- Is easy to use: you can use the `Configure::read()` and `Configure::write()` methods via the [`Setting`-class](#using-the-class).
- Also, you are able to read and write settings by your [console](#using-the-shell).
- Last but not least: If you use the [CakeAdmin Plugin](https://github.com/cakemanager/cakephp-cakeadmin) you get an [automatically generated form](#using-the-settings-form) :).

> Note: The Settings-plugin is prefix-minded. An example: `Prefix.Name`.

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org). For existing applications you can add the following to your `composer.json` file:

```
"require": {
	"jeffersonsimaogoncalves/cakephp-settings": "dev-master"
}
```

And run `/composer update`.

Configuration
-------------

[](#configuration)

You will need to add the following line to your application's bootstrap.php file:

```
Plugin::load('Settings', ['bootstrap' => true, 'routes' => true]);

// or run in your shell

$ bin/cake plugin load -b -r Settings
```

Next you need to create the table. Use the following command to initialize the settings-table.

```
$ bin/cake migrations migrate -p Settings

```

Usage
-----

[](#usage)

The `Setting`-class works the same like the `Configure`-class from CakePHP itself.

You can include the class with:

```
use Settings\Core\Setting;
```

### Write

[](#write)

You can write settings with the following:

```
Setting::write('App.Name', 'Custom Name');
```

The value `Custom Name` is now written to the database with the key `App.Name`. The empty array can contain multiple options

### Read

[](#read)

Now we gonna read the value from our just created key. Use:

```
Setting::read('App.Name');
```

This will return our value: `Custom Name`.

### Register

[](#register)

To prevent missing configurations when migrating to another environment the `register` method is introduced. Use the following to make sure the configuration exists in your application:

```
Setting::register('App.Name', 'Default Value', []);
```

#### Options

[](#options)

The following options are available:

- `description` - Description of your setting.
- `type` - Type to use like `text`, `select`, and more.
- `options` - Array with available options. In combination with the `type = select` option, this will generate a select-box with the given options.
- `editable` - Bool if the setting should be editable.
- `weight` - Weight (order) of the setting.

The options key can handle multiple types. You can define an array with options, but you can also create a close to prevent long queries on every request. Example:

```
Setting::register('App.Index', false, [
    'options' => function() {
        return TableRegistry::get('Blogs')->find('list')->toArray();
    }
]);
```

Using the setting-forms
-----------------------

[](#using-the-setting-forms)

If you are using the [CakeAdmin Plugin](https://github.com/cakemanager/cakephp-cakeadmin), we will create a default form where you can edit your settings (if the field `editable` isset to `1`). The Settings-Plugin will automatically add a menu-item to the admin-area.

If you click the menu-item you will see a list with all editable settings who contains the chosen prefix (or default: `App`).

### Register

[](#register-1)

To add your prefix to the settings-list use the following:

```
Configure::write('Settings.Prefixes.Test', 'Test');
```

Credits
-------

[](#credits)

This work is based on the [code by CakeManager](https://github.com/cakemanager/cakephp-settings).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance66

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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

202d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

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

---

Tags

Settingsormcakephpconfigure

### Embed Badge

![Health badge](/badges/jeffersonsimaogoncalves-cakephp-settings/health.svg)

```
[![Health](https://phpackages.com/badges/jeffersonsimaogoncalves-cakephp-settings/health.svg)](https://phpackages.com/packages/jeffersonsimaogoncalves-cakephp-settings)
```

###  Alternatives

[josegonzalez/cakephp-upload

CakePHP plugin to handle file uploading sans ridiculous automagic

5451.3M9](/packages/josegonzalez-cakephp-upload)[muffin/trash

Adds soft delete support to CakePHP ORM tables.

851.3M11](/packages/muffin-trash)[cakemanager/cakephp-settings

Settings plugin for CakePHP

236.8k2](/packages/cakemanager-cakephp-settings)[muffin/webservice

Simplistic webservices for CakePHP

88191.0k13](/packages/muffin-webservice)[admad/cakephp-sequence

Sequence plugin for CakePHP to maintain ordered list of records

46489.9k6](/packages/admad-cakephp-sequence)[riesenia/cakephp-duplicatable

CakePHP ORM plugin for duplicating entities (including related entities)

51384.5k4](/packages/riesenia-cakephp-duplicatable)

PHPackages © 2026

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