Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.4 KB

File metadata and controls

58 lines (42 loc) · 1.4 KB

Helper.Asset Module

Special Module help you manage Assets in codeHive 3 Framework.

Installation :

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>

Usage :

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("script.js@Container.Module");
$asset->style("style.css@Container.Module");

License

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