2017 © Pedro Peláez
 

yii2-extension yii2-settings

You settings

image

suver/yii2-settings

You settings

  • Thursday, July 26, 2018
  • by suver
  • Repository
  • 1 Watchers
  • 0 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 45 % Grown

The README.md

Frapse Your Settings

Your Settings, (*1)

Installation

Either run, (*2)

php composer.phar require suver/yii2-settings

or add, (*3)

"suver/yii2-settings": "*"

Install migrations, (*4)

yii migrate --migrationPath=@vendor/suver/yii2-settings/migrations

How USE



/** * Configure setting */ Settings::get('param-int')->configure(Settings::TYPE_INT); //=> true Settings::get('param-array')->configure(Settings::TYPE_ARRAY); //=> true Settings::get('param-param')->configure(Settings::TYPE_PARAM, [1 => ['text'=>'one'],2 => ['text'=>'two'],3 => ['text'=>'threa']]); //=> true /** * Set and configure setting */ Settings::get('param-int')->configure(Settings::TYPE_INT)->set(4); //=> true Settings::get('param-varchar')->configure(Settings::TYPE_VARCHAR)->set("string"); //=> true Settings::get('param-text')->configure(Settings::TYPE_TEXT)->set("text"); //=> true Settings::get('param-array')->configure(Settings::TYPE_ARRAY)->set([1,2,3,4]); //=> true Settings::get('param-param')->configure(Settings::TYPE_PARAM, [1 => ['text'=>'one'],2 => ['text'=>'two'],3 => ['text'=>'threa']])->set(3); //=> true Settings::get('param-option')->configure(Settings::TYPE_OPTIONS, [1=>'one', 2=>'two'])->set(2); //=> true Settings::get('param-param')->configure(Settings::TYPE_PARAM, [1 => ['text'=>'one'],2 => ['text'=>'two'],3 => ['text'=>'threa']])->set(5); //=> Exception /** * Set setting */ Settings::get('param-int')->set(4); //=> true Settings::get('param-varchar')->set("string"); //=> true /** * Return value */ print Settings::get('param-option-notset')->value(1); //=> one print Settings::get('param-option')->value(1); //=> two var_dump(Settings::get('param-option')->value(1)); //=> ['text'=>'threa'] var_dump(Settings::get('param-option')->param(1)); //=> 3 /** * Delete setting */ Settings::get('param-int')->delete(); //=> true /** * Clear setting */ Settings::get('param-varchar')->set("value"); //=> true Settings::get('param-varchar')->value(); //=> value Settings::get('param-varchar')->clear("); //=> true Settings::get('param-varchar')->value(); //=> null

The Versions

26/07 2018

dev-master

9999999-dev

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse

26/07 2018

1.0.10

1.0.10.0

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse

02/07 2018

1.0.9

1.0.9.0

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse

11/10 2016

1.0.8

1.0.8.0

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse

11/10 2016

1.0.7

1.0.7.0

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse

10/10 2016

1.0.6

1.0.6.0

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse

08/10 2016

1.0.5

1.0.5.0

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse

08/10 2016

1.0.4

1.0.4.0

You settings

  Sources   Download

Apache-2.0

The Requires

 

settings extension yii2 farpse