Download the PHP package kfosoft/yii2-app-dynamic-options without Composer

On this page you can find all versions of the php package kfosoft/yii2-app-dynamic-options. 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 yii2-app-dynamic-options

Yii2 Application Dynamic Options

Installation

Installation with Composer

Either run

    php composer.phar require kfosoft/yii2-app-dynamic-options:"*"

or add in composer.json

    "require": {
        ...
        "kfosoft/yii2-app-dynamic-options":"*"
    }

Copy migration and up

    vendor\kfosoft\yii2-app-dynamic-options\system\migrations\m000000_000001_init_options.php

or create your migration and configure in config

    kfosoft\yii2\system\Option::COMPONENT_NAME  => [ /** @todo Option component must have name 'yii2options'! */
            'class'        => kfosoft\yii2\system\Option::class, /* Component class */
            'tableName'    => 'Option', /* Optional. By default: 'option'. Table name. */
            'modelClass'   => kfosoft\yii2\system\models\Option::class, /* Optional. By default: '\kfosoft\yii2\system\models\Option'. Model class. */
            'modelSearchClass' => kfosoft\yii2\system\models\OptionSearch::class, /* Optional. By default: '\kfosoft\yii2\system\models\OptionSearch'. Search model class. */
            'tableKeyField' => 'key', /* Optional. By default: 'key'. Table key field. */
            'tableValueField' => 'value', /* Optional. By default: 'value'. Table value field. */
            'cacheKey', => 'yii2options', /* Optional. By default: 'yii2options'. Cache key. */
            'manageAction' => '/admin/options/manage',
            'updateAction' => '/admin/options/update',
            'manageView' => '@yii2options/views/manageOptions', /* Optional. By default: '@yii2options/views/manageOptions'. Manage view path. */
            'updateView' => '@yii2options/views/updateOptions', /* Optional. By default: '@yii2options/views/updateOptions'. Update view path. */
            'translations' => [
                'class'          => 'yii\i18n\PhpMessageSource',
                'sourceLanguage' => 'en-US',
                'basePath'       => '@yii2options/messages',
                'fileMap'        => [],
            ], /* Optional. By default: this array. I18n params. */
            'connectionName' => 'db', /* Optional. By default: 'db'. Database component name. */
    ],

and add in bootstrap

    'bootstrap'      => ['log', 'urlManager', kfosoft\yii2\system\Option::COMPONENT_NAME],

This extension has two commands

- options                            List commands to manage dynamic options.
    options/clear                    Clear db params in database.
    options/push                     Push params from application config.

Well done!

Example

config/params.php

<?php

return [
    'admin.email' => [
        'value' => '[email protected]', /* Param value. */
        'comments' => Yii::t('app', 'Comment 1'), /* Comment for this param. */
        'edit' => true, /* Can you edit this param? */
        'validator' => 'string' /* Validator. 'string', 'integer', callable. */
    ],
    'param.array' => [
        'value' => [5, 10, 15, 20, 25],
        'comments' => Yii::t('app', 'Comment 2'),
        'edit' => true,
        'validator' => function ($model, $value, $key) { ... }, /* Callable validator. */
        'getValue' => function ($value) { ... }, /* Work for grid view value & active form value. */
        'setValue' => function ($value) { ... }, /* Work for active form value. */
    ],
    'param.2' => [
        'value' => 5,
        'comments' => Yii::t('app', ''),
        'edit' => true,
        'validator' => 'integer',
        'afterFind' => function ($model, $event) { ... }, /* Model event. @var string $event */
        'beforeValidate' => function ($model, $event) { ... }, /* Model event. @var string $event */ 
        'afterValidate' => function ($model, $event) { ... }, /* Model event. @var string $event */
        'beforeSave' => function ($model, $event, $insert) { ... }, /* Model event. @var string $event */
        'afterSave' => function ($model, $event, $insert, $changedAttributes) { ... }, /* Model event. @var string $event */
    ],
    'param.3' => 'dd/MM/yyyy', /* this line = ['value' => 'dd/MM/yyyy', 'comments' => 'N/A', 'edit' => false, 'validator' => 'string'] */
];

Enjoy, guys!


All versions of yii2-app-dynamic-options with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
kfosoft/php-int-enum-x64 Version 20.11
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 kfosoft/yii2-app-dynamic-options contains the following files

Loading the files please wait ....