From 1dae3206859de34caf0ae8dffbcb0b86f8b881c2 Mon Sep 17 00:00:00 2001 From: Charlie Shehadi Date: Tue, 19 Nov 2019 11:04:02 -0500 Subject: [PATCH] fix CamelCase plugins fail --- src/FroalaEditorAsset.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/FroalaEditorAsset.php b/src/FroalaEditorAsset.php index 84d78a3..3800374 100644 --- a/src/FroalaEditorAsset.php +++ b/src/FroalaEditorAsset.php @@ -4,6 +4,7 @@ use yii\base\Exception; use yii\helpers\ArrayHelper; +use yii\helpers\Inflector; use yii\web\AssetBundle; /** @@ -61,6 +62,10 @@ public function registerClientPlugins($clientPlugins, $excludedPlugins) { $pluginNames = []; if (is_array($clientPlugins)) { + // documentation lists plugins in CamelCase, but this Asset code expects underscore, so convert to underscore + $clientPlugins = array_map(function ($plugin) { + return is_array($plugin) ? $plugin : Inflector::underscore($plugin); + }, $clientPlugins); if (ArrayHelper::isIndexed($clientPlugins, true)) { // sequential array = list of plugins to be included // use default configurations for every plugin