PHP code example of traineratwot / web-tool-template

1. Go to this page and download the library: Download traineratwot/web-tool-template 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/ */

    

traineratwot / web-tool-template example snippets


/**
 * @param $key mixed
 * @param $value mixed
 * @param $expire int
 * @param $category string
 * @return mixed
 */
Cache::setCache($key,$value,$expire=600,$category = '');

/**
 * @param $key mixed
 * @param $category string
 * @return mixed|null
 */
Cache::getCache($key,$category = '');
/**
 * @param $key mixed
 * @param $category string
 * @return bool
 */
Cache::removeCache($key,$category = '');

Console::info('text') //print cyan text;
Console::success('text') //print green text;
Console::warning('text') //print yellow text;
Console::failure('text') //print red text;
Console::prompt('Are you sure you?', ?hidden)// ask user in console
/**
 * @param $string
 * @param $foreground_color
 * @param $background_color
 * @return mixed|string
 */
Console::getColoredString('text','red','yellow') //return colored string

Console::foreground_colors //list text color
Console::background_colors //list background color



Config::get('key','?namespace') //return value;
Config::set('key','value','?namespace') //set value;
// тоже самое но с возможностью перезаписывать в процессе выполнения
ConfigOverridable::set('OverridableKey','value','?namespace')
ConfigOverridable::get('OverridableKey','?namespace')
Config::get('OverridableKey','?namespace') //return value;