PHP code example of istranger / yii-resource-smart-load

1. Go to this page and download the library: Download istranger/yii-resource-smart-load library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

istranger / yii-resource-smart-load example snippets


// application components
'components' => array(
    // ...
    'clientScript' => array(
        // Path of main class: 
            // -- if installed manually: 
        'class' => 'ext.yii-resource-smart-load.RSmartLoadClientScript', 
            // -- if installed via composer: 
        // 'class' => 'application.vendor.istranger.yii-resource-smart-load.RSmartLoadClientScript',  
                    
        // Hashing method for resource names,
        // see possible values: http://php.net/manual/en/function.hash.php#104987 
        // 'hashMethod' => 'md5', // default = 'crc32b'
        
        // Types of resources, that will be tracked by current extension. 
        // If =null, 

    'resourceTypes' => array('jsFile', 'jsInline'), // or  => array('jsFile')

    'enableLog' => true, // default = false

    array(
        RSmartLoadClientScript::RESOURCE_TYPE_JS_FILE,      // = 'jsFile'
        RSmartLoadClientScript::RESOURCE_TYPE_JS_INLINE,    // = 'jsInline'
        RSmartLoadClientScript::RESOURCE_TYPE_CSS_FILE,     // = 'cssFile'
        RSmartLoadClientScript::RESOURCE_TYPE_CSS_INLINE,   // = 'cssInline'
    )

    'alwaysReloadableResources' => array('jquery.yiiactiveform.js')  // default = array()