Download the PHP package monsieurbiz/sylius-settings-plugin without Composer

On this page you can find all versions of the php package monsieurbiz/sylius-settings-plugin. 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 sylius-settings-plugin

Settings for Sylius

Settings Plugin license Tests Status Recipe Status Security Status

This plugin gives you the ability to have Plugins oriented settings in your favorite e-commerce platform, Sylius.

Compatibility

Sylius Version PHP Version
1.12 8.1 - 8.2 - 8.3
1.13 8.1 - 8.2 - 8.3
1.14 8.1 - 8.2 - 8.3

Installation

If you want to use our recipes, you can configure your composer.json by running:

⚠️ Warning: For Doctrine DBAL < 3.0

You have to ignore migration `Version20240710130300.php` if you are under Doctrine DBAL < 3.0.

For the installation without flex, follow these additional steps

Change your `config/bundles.php` file to add this line for the plugin declaration: Then create the config file in `config/packages/monsieurbiz_settings_plugin.yaml` : Finally import the routes in `config/routes/monsieurbiz_settings_plugin.yaml` :

Update your database:

Continue to "How it works" to add your first setting for your store.

Note: you may encounter an error during the installation via composer if you let it run the scripts.
Copy the configuration files and rerun the composer require, it should work. This is due to the use of other plugins in the DI. The configuration is then required to run any console command.

How it works

As a good start you can have a look at:

Then you can get your settings using a twig function: setting().
Have a look at this example.

You can also use the DI to get your Settings, as example with the settings in the test Application app.default:

Note: the "Settings" menu won't appear until you have at least one setting.

Fetch settings

Use fixtures

We've implemented a fixtures loader to help you to create your settings if you need to have different settings for your tests or project (by channel, by locale…).

You need to create a yaml file with your fixtures, like explained in the documentation of Sylius.
You can find our own example in the source code, section sylius_fixtures: configuration file.

It's also possible to run test fixtures with a local suite in development: make sylius.fixtures.local.

By default, a fixture will replace the value of a setting if it already exists. If you want to keep a value as it is in the database when running this fixture, you can use the flag ignore_if_exists: true for each element that you want to be kept.

Extends existing settings form

If you want to add a field to an existing settings form (like in another plugin), you can check the example in the test app

Use CLI

You can use a CLI command to set a value for a setting directly from the console: $ ./bin/console monsieurbiz:settings:set {alias} {path} {value} --channel="FASHION_WEB" --locale="en_US" --type="text"

Examples:

The options channel and locale can be omitted if you want to set the value for a global scope. If a value exists for the given scope the type can be omitted as it will be the same as the existing one unless you want to change the type. For a new value you need to specify the type.

⚠️ When specifying the type, be sure to know what you are doing as it should be coherent with the Form Type of the field.

Use cache

Settings use cache.adapter.array adapter by default. If you want to increase performance, you can use cache.adapter.apcu, cache.adapter.redis or any adapters instead.

You had to add the following lines to your config file:

Contributing

You can find a way to run the plugin without effort in the file DEVELOPMENT.md.

Then you can open an issue or a Pull Request if you want! 😘
Thank you!

License

This plugin is completely free and released under the MIT License.


All versions of sylius-settings-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
sylius/sylius Version >=1.12 <2.0
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 monsieurbiz/sylius-settings-plugin contains the following files

Loading the files please wait ....