This is a base library with set of foundation classes and components used by all Yii2 extensions by Krajee. One can use this base library during creation of one's own extensions if needed.
NOTE: This extension depends on the yiisoft/yii2-bootstrap and/or yiisoft/yii2-bootstrap4 extensions. Check the composer.json for this extension's requirements and dependencies.
To ensure a leaner code base / foundation component for use in all Krajee extensions (e.g. yii2-widgets, yii2-datecontrol, yii2-grid, yii2-dynagrid etc.). This should allow most developers to plug and play components only they need, without needing the complete suite of widgets. For example, this mitigates this issue.
NOTE: Refer the CHANGE LOG for details on changes to various releases.
Extends Yii Module class for Krajee's Yii2 widgets and usage with translation properties enabled.
Extends Yii Widget class for Krajee's Yii2 widgets and usage with bootstrap CSS framework.
Extends Yii InputWidget class for Krajee's Yii2 widgets and usage with bootstrap CSS framework. With release v1.3.0, the Input widget automatically now attaches the following HTML5 data attribute for each input that registers jQuery plugins via registerPlugin
method:
data-krajee-{name}
the client options of the plugin. The tag {name}
will be replaced with the registered jQuery plugin name (e.g. select2
, typeahead
etc.).A trait for handling translation functionality using Yii's i18n components.
The interface that defines the constants and method signatures for bootstrap 3.x, 4.x, and 5.x versions that will be implemented in all classes that use BootstrapTrait
.
A trait for bootstrap 3.x, 4.x, and 5.x version parsing functionality for Krajee extensions (the class using this trait must implement BootstrapInterface
).
A trait for rendering bootstrap 3.x, 4.x, or 5.x input group addons.
A trait for Krajee widgets including prebuilt methods for plugin registration.
Extends Yii AssetBundle class for Krajee's Yii2 widgets with enhancements for using minimized CSS and JS based on debug mode.
Extension of the above AssetBundle to include dependency on Bootstrap assets and javascript plugins.
An asset bundle for loading various CSS3 animations and effects.
A modified input widget for rendering HTML5 inputs with bootstrap styling and input group addons for Krajee's Yii 2 extensions.
A global configuration and validation helper class for usage across Krajee's Yii 2 extensions.
A base class for modified standard PHP internal functions. It is specifically built to address warnings in PHP v8.1 and above due to null arguments passed to PHP internal functions which results in deprecation errors in PHP v8.1 and beyond.
The preferred way to install this extension is through composer.
Note: Read this web tip /wiki on setting the
minimum-stability
settings for your application's composer.json.
Either run
$ php composer.phar require kartik-v/yii2-krajee-base "dev-master"
or add
"kartik-v/yii2-krajee-base": "dev-master"
to the require
section of your composer.json
file.
yii2-krajee-base is released under the BSD-3-Clause License. See the bundled LICENSE.md
for details.
yii2-krajee-base
Date: 01-Jun-2022
sourcePath
added to WidgetTrait
and used in Widget
and InputWidget
.
/**
* @var string directory path to the original widget source. If not set, will default to the working directory for
* the current widget's class. Setting this property can be useful in specific cases, like when you are extending
* the Krajee widget with your own custom namespaced class. In that case, set this property to the original Krajee
* Widget Base path. Yii path alias parsing is supported (using `@` symbols). For example:
* ~~~
* // your custom extended widget
* namespace myapp\widgets;
* class MyDateRangePicker extends kartik\daterange\DateRangePicker {
* // directly set the property to the original Krajee base widget directory
* // you can use Yii path aliases
* public $sourcePath = '@vendor/kartik-v/yii2-date-range/src';
* }
*
* // Alternatively you can also override this property while rendering the widget
* // view.php: where widget is rendered
* use myapp\widgets\MyDateRangePicker;
*
* echo MyDateRangePicker::widget([
* 'name' => 'custom',
* 'sourcePath' => '@vendor/kartik-v/yii2-date-range/src'
* ]);
* ~~~
*/
public $sourcePath;
Date: 26-Feb-2022
substr
function use and add new strncmp
method.Date: 26-Feb-2022
Lib
for PHP internal base methods (for addressing NULL params deprecation in PHP versions >= v8.1).Date: 10-Jan-2022
getDropdownClass
.Date: 03-Sep-2021
Date: 01-Sep-2021
Date: 08-Apr-2021
BS_PANEL_SECONDARY
.Date: 13-Mar-2019
BS_HIDE
.Date: 04-Dec-2018
pjaxDuplicationFix
available in widgets/extensions that use kartik\base\WidgetTrait
Yii::$app->params['pjaxDuplicationFix']
Yii::$app->params['pjaxDuplicationFix']
if not set will default to true
Yii::$app->params['pjaxDuplicationFix']
will globally control the pjax duplication fix for all Krajee widgetsDate: 27-Nov-2018
AssetBundle::bsDependencyEnabled
via Yii::$app->params
.Date: 26-Nov-2018
bsDependencyEnabled
in kartik\base\AssetBundle
(Note that all Krajee extension asset bundles based on bootstrap styles extend this class). The property bsDependencyEnabled
defaults to true
whereby based on the bsVersion
, the asset bundle dependency is set with one of yii\bootstrap\BootstrapAsset
or yii\bootstrap4\BootstrapAsset
. If one needs custom control and load their own bootstrap assets - set this property to false
via yii2 asset manager component in your yii2 application config.Date: 10-Nov-2018
addCssClass
& removeCssClass
methods in BootstrapTrait
for easy chaining of these methods.yii2-bootstrap
or yii2-bootstrap4
installs.Date: 09-Oct-2018
bsVersion
initialization.Date: 27-Sep-2018
BootstrapTrait::getCssClass
method.Date: 27-Sep-2018
Date: 26-Sep-2018
Date: 22-Sep-2018
BootstrapInterface
and bsColCssPrefixes
.Date: 20-Sep-2018
Config
to include Config::hasCssClass
method.Date: 05-Sep-2018
InputWidget
. Date: 29-Aug-2018
Module
to include bsVersion
configuration.AssetBundle
to include new method registerBundle
for reading BS Version from widgets.BootstrapTrait
to include better BS Version parsing methods.Date: 20-Aug-2018
Date: 16-Aug-2018
yii2-bootstrap4
dependency.Date: 12-Aug-2018
animate.css
to latest release.src
folder.getModule
to retrieve correct module.Date: 29-Sep-2017
hashVarLoadPosition
for InputWidget and Widget.Date: 22-Feb-2017
BaseAssetBundle
without JQuery and Bootstrap assets dependency.Date: 04-Sep-2016
Date: 19-Aug-2016
Date: 08-May-2016
enablePopStateFix
(addendum to #59).pluginEvents
.document.body
on load
event and trap the plugin selector identifier within that.Html5Input
widget init.yii\web\YiiAsset
.Date: 11-Apr-2016
Date: 09-Apr-2016
Date: 10-Jan-2016
pluginDestroyJs
for destroying plugin before initializationDate: 27-Dec-2015
Date: 11-Dec-2015
Config::getModule
.Date: 25-Nov-2015
Date: 22-Nov-2015
Html5Input
initialization.Date: 16-Jun-2015
Json::htmlEncode
as per yii release v2.0.4.Date: 09-May-2015
Date: 03-May-2015
addLanguage
method in AssetBundle
.Date: 13-Feb-2015
getModule
and initModule
methods in Config
.Date: 25-Jan-2015
Widget
options to store multiple plugin config.Date: 20-Jan-2015
Date: 15-Jan-2015
Date: 12-Jan-2015
Date: 16-Dec-2014
$short
in InputWidget
in method setLanguage
set without $prefix
.parseDateFormat
to convert formats rightly to PHP DateTime format.noSupport
message translation in Html5Input
.Html5Input
.Date: 06-Dec-2014
disabled
and readonly
to InputWidget
and Html5Input
.
initDisability
is been created for disability validation across Input Widgetsdisabled
or readonly
optionDatePicker
or DateTimePicker
InputWidget
to include getPluginScript
method. self
methods to static
.getPluginScript
.Date: 29-Nov-2014
setLanguage
method in InputWidget
initLanguage
method to include a parameter full
which defaults to false
to use the ISO-639 language code.(enh #10): Enhanced language and directory methods in Config
Two new methods is added to Config helper class:
getCurrentDir
- gets the current directory of the extended class objectfileExists
- modified file_exists method after replacing the slashes with right directory separatorDate: 25-Nov-2014
InputWidget
for attaching multiple jQuery plugins.The following HTML5 data attributes are removed and not registered anymore with the input:
data-plugin-name
the name of the plugindata-plugin-options
the client options of the pluginFollowing functionality included in InputWidget
and Widget
classes:
_pluginName
for easy configuration in individual widgets.data-krajee-{name}
the client options of the plugin. The tag {name}
will be replaced with the
registered jQuery plugin name (e.g. select2
, typeahead
etc.)._dataVar
included for generating the above data attribute.Date: 25-Nov-2014
Config
.InputWidget
.Date: 10-Nov-2014
Html5Input
class and Html5InputAsset
bundle.AnimateAsset
bundle.Date: 06-Nov-2014
Initial release
Comments