Search by

drago-ex / project-settings

accgit

Individual settings for the application.

Package info

github.com/drago-ex/project-settings

Type:drago-tools-resource

pkg:composer/drago-ex/project-settings

Statistics

Installs: 118

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.0 2026-10-31 14:45 UTC

This package is auto-updated.

Last update: 2026-11-01 16:35:10 UTC


README

Individual settings for the application.

PHP version Tests Coding Style

Requirements

Installation

composer require drago-ex/project-settings

Files copied into the project

The files are copied into the project by drago-ex/project-tools, as set in extra.drago-tools of this package's composer.json.

Administration

The settings page is available as:

{link :Backend:Settings:}

With drago-ex/project-backend-ui, add the links to its menu (see its README).

The form has a field for every row of the settings table, labelled by its name (website, description). The labels are translated: when you add a setting to the database, add the translation of its name to app/Presentation/Backend/Settings/Translate/cs.neon, otherwise the field shows the name itself.

Use in the presenter

Add the trait to a base presenter whose templates need application settings:

use App\Core\Settings\SettingsRequire;
use Nette\Application\UI\Presenter;

abstract class BasePresenter extends Presenter
{
	use SettingsRequire;
}

Use in Latte template

{varType App\Core\Settings\Settings $settings}

{* website name *}
{$settings->get('website')}

{* website description *}
{$settings->get('description')}

{if $settings->has('website')}
	{$settings->get('website')}
{/if}

Optional add-ons

The package works without them. Set them up by hand as described below when the project needs them.

Permission provider

With drago-ex/permission, the access rules from bin/create-settings-permission are generated into the project by:

php vendor/bin/drago-commands