Welcome Guest, Not a member yet? Register   Sign In
AssetLibPro - An advanced CI Asset Library
#33

[eluser]Nicholas Hanks[/eluser]
This is what I did in controller
Code:
public function __construct()
{
  parent::Controller();
  $this->load->helper(array('html'));
  $this->load->model('Income');
  $this->load->library('assetlibpro');
  $this->config->load('assetlibpro');
  $this->assetlibpro->add_css(base_url().'css/index.css');
  $this->assetlibpro->add_css(base_url().'css/icon.css');
}
This is what I did in View File
Code:
<?php
echo $this->assetlibpro->output('all');
?>
This is how my assetlib config is
Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* AssetLibPro - A CodeIgniter Asset Class
*
* @version of AssetLibPro:    1.0.5
*/

/*
|--------------------------------------------------------------------------
| Asset storage
|--------------------------------------------------------------------------
|
| The path to where to storage the joined assets.
| alp_cache_dir_css = "/assets/compressed/" (as example)
|
*/
$config['alp_asset_dir'] = '/assets/';//TRAILING SLASH!
$config['alp_cache_dir_css'] = '/assets/compressed/';//TRAILING SLASH!
$config['alp_cache_dir_js'] = '/assets/compressed/';//TRAILING SLASH!

/*
|--------------------------------------------------------------------------
| Asset default groups
|--------------------------------------------------------------------------
|
| This allows you set a default group adding assets without having to
| particularly specify the group on every "add_css()" or "add_js()"
|
*/
$config['alp_default_group_css'] = 'screen';
$config['alp_default_group_js'] = 'default';

/*
|--------------------------------------------------------------------------
| Toggle CSSTidy/JSMin Compression
|--------------------------------------------------------------------------
|
| Whether to run compression using csstidy or jsmin
|
*/
$config['alp_enable_csstidy'] = TRUE;
$config['alp_enable_jsmin'] = TRUE;

/*
|--------------------------------------------------------------------------
| Toggle GZip Compression
|--------------------------------------------------------------------------
|
| Whether to compression the output using gzip
|
*/
$config['alp_gzip_compress_css'] = FALSE;
$config['alp_gzip_compress_js'] = FALSE;

/*
|--------------------------------------------------------------------------
| Toggle Browser Caching
|--------------------------------------------------------------------------
|
| Whether to force the browser to cache the files
| (Even with caching enabled web browsers will still detect changes automatically!)
|
*/
$config['alp_force_cache_css'] = TRUE;
$config['alp_force_cache_js'] = TRUE;

/*
|--------------------------------------------------------------------------
| Alternative development server configuration
|--------------------------------------------------------------------------
|
| Allows you to use different settings for your development (localhost?) server
|
*/
$enable_dev_server_config = TRUE;
$dev_server_name = 'localhost'; //Replace "localhost" with your dev server name if needed or just use a custom conditional expression.
if ($_SERVER['SERVER_NAME'] == $dev_server_name && $enable_dev_server_config == TRUE) {
    $config['alp_enable_csstidy'] = TRUE;
    $config['alp_enable_jsmin'] = TRUE;
    
    $config['alp_gzip_compress_css'] = FALSE;
    $config['alp_gzip_compress_js'] = FALSE;
    
    //error_reporting(E_ALL);//Comment it out if not wanted.
}

/*
|--------------------------------------------------------------------------
| CSSTidy Config
|--------------------------------------------------------------------------
|
| The path from your site's root in which the csstidy folder is. Note
| this is from the site's root, not the file system root. Also note the
| required slashes at start and finish.
|
| csstidy_basepath = "/system/plugins/csstidy" (as example)
|
*/
$config['alp_csstidy_basepath']    = "/plugins/csstidy/";

$config['alp_csstidy_config'] = array(
                                  'remove_bslash' => TRUE,
                                  'compress_colors' => TRUE,
                                  'compress_font-weight' => TRUE,
                                  'lowercase_s' => FALSE,
                                  'optimise_shorthands' => 1,
                                  'remove_last_,' => TRUE,
                                  'case_properties' => 1,
                                  'sort_properties' => FALSE,
                                  'sort_selectors' => FALSE,
                                  'merge_selectors' => 2,
                                  'discard_invalid_properties' => FALSE,
                                  'css_level' => 'CSS2.1',
                                  'preserve_css' => FALSE,
                                  'timestamp' => FALSE
                                 );
$config['alp_csstidy_template'] = "highest_compression";

/*
|--------------------------------------------------------------------------
| JSmin Config
|--------------------------------------------------------------------------
|
| Enter the path to your jsmin.php file. (relative from BASEPATH)
|
| jsmin = "/system/plugins/jsmin1.1.1.php" (as example)
|
*/
$config['alp_jsmin']    = "/plugins/jsmin.php";

?>
Lastly Thanks a lot for your response. Please help me


Messages In This Thread
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 04:59 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 12:59 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 01:31 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 01:35 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 01:41 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 02:10 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 02:18 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 02:22 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 02:31 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 02:37 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-08-2008, 02:50 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-22-2008, 08:17 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-22-2008, 08:29 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-28-2008, 12:05 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-28-2008, 05:57 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-28-2008, 06:50 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-28-2008, 06:55 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-31-2008, 04:07 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 06-02-2008, 07:10 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 06-02-2008, 09:05 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 06-02-2008, 11:20 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 06-03-2008, 06:00 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 06-03-2008, 08:11 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 08-01-2008, 12:19 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 08-01-2008, 07:19 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 08-01-2008, 09:21 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 08-02-2008, 02:41 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 08-02-2008, 05:44 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 08-05-2008, 09:38 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 08-05-2008, 04:12 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-05-2008, 11:24 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 02:28 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 08:34 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 09:09 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 10:27 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 12:33 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 12:47 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 04:24 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-06-2008, 09:30 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-07-2008, 03:42 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-09-2008, 02:49 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 11-23-2008, 02:17 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 12-23-2008, 06:30 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 01-09-2009, 07:51 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 01-09-2009, 09:55 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 01-14-2009, 12:13 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 01-28-2009, 07:51 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 01-30-2009, 08:16 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 03-04-2009, 08:37 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 03-05-2009, 08:23 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 03-05-2009, 08:49 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 03-06-2009, 03:02 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 06-11-2009, 03:28 PM
AssetLibPro - An advanced CI Asset Library - by El Forum - 07-23-2009, 02:51 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 07-23-2009, 07:19 AM
AssetLibPro - An advanced CI Asset Library - by El Forum - 05-30-2010, 04:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB