PHP code example of anklimsk / cakephp-config-plugin

1. Go to this page and download the library: Download anklimsk/cakephp-config-plugin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anklimsk / cakephp-config-plugin example snippets


   CakePlugin::load('CakeConfigPlugin', ['bootstrap' => true]);
   

       public $actsAs = [
           'CakeConfigPlugin.InitConfig' => [
               'pluginName' => 'SomePluginName',
               'checkPath' => 'SomePluginName.param'
           ]
       ];
   

       $config['SomePluginName'] = [
           'param' => 'value'
           ...
       ];
   

   Configure::write('SomePluginName.param', 'newValue');

   //  After, in Model call:
   $this->initConfig(true);
   

   App::uses('InitConfig', 'CakeConfigPlugin.Utility');

   $pluginName = 'SomePluginName';
   $checkPath = 'SomePluginName.param';
   $configFile = 'somepluginname';
   $initConfig = new InitConfig($pluginName, $checkPath, $configFile);

   $force = false;
   $initConfig->initConfig($force);