Download the PHP package vsavritsky/settingsbundle without Composer

On this page you can find all versions of the php package vsavritsky/settingsbundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package settingsbundle

VsavritskySettingsBundle

This bundle helps you to manage your settings in Symfony4 project.

Settings has one of types: Boolean, Integer, Float, String, Text, Html. You may get one concrete setting or fetch group of settings. Fetching of settings may be cached by your cache provider used in project.

Management of settings provides by SonataAdminBundle. In other case you may manage settings via code by use special functions or predefined forms.

Installation

Composer

Download VsavritskySettingsBundle and its dependencies to the vendor directory.

You can use Composer for the automated process:

or manually add link to bundle into your composer.json and run $ composer update:

Composer will install bundle to vendor/vsavritsky/settingsbundle directory.

Adding bundle to your application kernel

Configuration

Bundle does not need any required parameters and will work without changes in config.yml. But you may config some parameters, read more below.

Now you need create the tables in your database:

or in Symfony2:

This will show SQL queries for creating of tables in the database. You may manually run these queries.

Note. You may also execute php bin/console doctrine:schema:update --force command, and Doctrine will create needed tables for you. But I strongly recommend you to execute --dump-sql first and check SQL, which Doctrine will execute.

Note. If you use 1.1.* version of bundle, you need to update database.

Usage

Use SonataAdminBundle for manage your settings. Otherwise use predefined forms. You feel free to use the bundle if you configure settings with database tool (phpMyAdmin or other) or by use special functions called in your code (see below).

You may put settings to group or not. Groups may be used for fetching several settings at one query.

Fetching of settings are supported in twig templates or in controller (or in any script where settings service are injected).

For example, you created 3 settings:

Use in controller
Use in template

Advanced usage

Full configuration

Here is the default configuration for the bundle (all parameters are optional):

ckeditor form type may be added by IvoryCKEditorBundle. If you are using CKEditor without IvoryCKEditorBundle, you must specify the parameters base_path and js_path.

Groups of settings

For fetch several of settings from one group you may use one of two cases:

Both of cases has an identical perfomance - the whole group will fetch while first access to it, fetching of data will be only one time.

Using groups in twig

Example of using the settings group

There is an example of group using - settings which used in backend and frontend. Several settings are placed in client group, and include to template:

Perfomance and caching

Use caching for increase of fetching settings. If you don't use caching already - it is perfect time to do! It's very simple!

The bundle will use registered service cache.app for cache data. Cache provider may be one of Doctrine cache or Symfony cache - PSR-6 Cache (Symfony 3.1) or PSR-16 Simple Cache (Symfony 3.3).

Arrange Settings admin group in SonataAdminBundle

SonataAdminBundle arranges admin groups by its bundles in AppKernel::registerBundles(). If vsavritskySettingsBundle is added above your app bundles, then Settings group will be first group in menu (before your content or service groups, created in your bundles). If you want that settings group will be last group (below your groups), you add vsavritskySettingsBundle after your bundle in AppKernel::registerBundles():

Manage settings without Sonata Admin

If you don't use SonataAdminBundle in your project, you may use predefined forms or special functions.

Use predefined forms (in controller)

Save setting:

Save group:

For use predefined forms, you need add form theme:

Manual create and update settings

All versions of settingsbundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
symfony/framework-bundle Version >=4
fresh/doctrine-enum-bundle Version >=4.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vsavritsky/settingsbundle contains the following files

Loading the files please wait ....