Class kartik\base\Config
Inheritance | kartik\base\Config |
---|---|
Available since version | 1.0 |
Global configuration helper class for Krajee extensions
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_validDropdownInputs | kartik\base\Config | ||
$_validHtmlInputs | kartik\base\Config | ||
$_validInputWidgets | kartik\base\Config |
Public Methods
Method | Description | Defined By |
---|---|---|
checkDependencies() | Validate multiple extension dependencies | kartik\base\Config |
checkDependency() | Validate a single extension dependency | kartik\base\Config |
fileExists() | Check if a file exists | kartik\base\Config |
getCurrentDir() | Get the current directory of the extended class object | kartik\base\Config |
getInputWidgets() | Gets list of namespaced Krajee input widget classes as an associative array, where the array keys are the namespaced classes, and the array values are the names of the github repository to which these classes belong to. | kartik\base\Config |
getLang() | Convert a language string in yii\i18n format to a ISO-639 format (2 or 3 letter code). | kartik\base\Config |
getModule() | Gets the module | kartik\base\Config |
initModule() | Initializes and validates the module | kartik\base\Config |
isDropdownInput() | Check if a input type is a valid dropdown input | kartik\base\Config |
isHtmlInput() | Check if a input type is a valid Html Input | kartik\base\Config |
isInputWidget() | Check if a type of input is a valid input widget | kartik\base\Config |
isValidInput() | Check if a type of input is any possible valid input (html or widget) | kartik\base\Config |
validateInputWidget() | Check if a namespaced widget is valid or installed. | kartik\base\Config |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
DEFAULT_REASON | "for your selected functionality" | kartik\base\Config | |
NAMESPACE_PREFIX | "\\kartik\\" | kartik\base\Config | |
VENDOR_NAME | "kartik-v/" | kartik\base\Config |
Property Details
Method Details
Validate multiple extension dependencies
public static void checkDependencies ( $extensions = [] ) | ||
$extensions | array | The configuration of extensions with each array
item setup as required in
|
throws | \yii\base\InvalidConfigException | if extension fails dependency validation |
---|
Validate a single extension dependency
public static void checkDependency ( $name = '', $repo = '', $reason = self::DEFAULT_REASON ) | ||
$name | string | The extension class name (without vendor namespace prefix) |
$repo | mixed | The extension package repository names (without vendor name prefix) |
$reason | string | A user friendly message for dependency validation failure |
throws | \yii\base\InvalidConfigException | if extension fails dependency validation |
---|
Check if a file exists
public static bool fileExists ( $file ) | ||
$file | string | The file with path in URL format |
Get the current directory of the extended class object
public static string getCurrentDir ( $object ) | ||
$object | mixed | The called object instance |
Gets list of namespaced Krajee input widget classes as an associative array, where the array keys are the namespaced classes, and the array values are the names of the github repository to which these classes belong to.
public static void getInputWidgets ( ) |
Convert a language string in yii\i18n format to a ISO-639 format (2 or 3 letter code).
public static string getLang ( $language ) | ||
$language | string | The input language string |
Gets the module
public static kartik\base\Module getModule ( $m ) | ||
$m | string | The module name |
Initializes and validates the module
public static \yii\base\Module initModule ( $class ) | ||
$class | string | The Module class name |
throws | \yii\base\InvalidConfigException |
---|
Check if a input type is a valid dropdown input
public static void isDropdownInput ( $type ) | ||
$type | string | The type of input |
Check if a input type is a valid Html Input
public static void isHtmlInput ( $type ) | ||
$type | string | The type of input |
Check if a type of input is a valid input widget
public static void isInputWidget ( $type ) | ||
$type | string | The type of input |
Check if a type of input is any possible valid input (html or widget)
public static void isValidInput ( $type ) | ||
$type | string | The type of input |
Check if a namespaced widget is valid or installed.
public static void validateInputWidget ( $type, $reason = self::DEFAULT_REASON ) | ||
$type | ||
$reason | ||
throws | \yii\base\InvalidConfigException |
---|