Special Module help you manage Assets in codeHive 3 Framework
.
you can simply install it from hive command line as :
hive install Helper.Asset
Asset helper need Special Directives to defined in index.html file allowing events to dispatched correctly in position.
<Asset load="defaults"></Asset>
<Asset load="style"></Asset>
<Asset load="definer"></Asset>
<Asset load="script"></Asset>
<Asset load="head"></Asset>
or one loader to load all
<asset load="defaults,style,definer,script,head"></asset>
initialize Asset Helper Module
use App\Helper\Asset;
$asset = new Asset;
define javascript variables
$asset->jsDefine("angular.options.first", "SomeValue");
$asset->jsDefine("angular.options.secound", ["name" => "original name", "pass"=>"123456"]);
$asset->jsDefine("angular.options.secound.name", "updated name");
append to array and create path in js
// you can access from javascript as [codeHive.angular.plugins]
$asset->jsPush("angular.plugins", "PluginName");
define script or style
$asset->script("[email protected]");
$asset->style("[email protected]");
Copyright (c) 2013 - 2017, Purecis, Inc. All rights reserved.
This Module is part of codeHive framework and its open-sourced software licensed under the MIT license