• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asset Helper for The CKEditor and Filemanager

#1
I use a ./application/helpers/asset_helper.php The code is below.

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

/**
 * ------------------------------------------------------------------------
 * Created by phpDesigner 2016.1.
 * Date  : 03/23/2016
 * Time  : 6:15:20 PM
 * Author: Raymond L King Sr.
 * ------------------------------------------------------------------------
 *
 * Helper    assets_helper
 *
 * ------------------------------------------------------------------------
 */

/**
 * Expects that all resources are in an assets directory in the root folder.
 *
 * application
 * system
 * index.php
 * assets
 * -- css
 * -- js
 * -- img
 * -- images
 * -- ico
 * -- media
 * -- themes
 * -- etc
 *
 * Usage:
 *
 *  <?php echo asset('app.css'); ?>
 *
 * You can also pass in a directory to the method's
 *
 *  <?php echo asset('directory/app.css'); ?>
 *
 */


/**
 * Helper asset ()
 * ------------------------------------------------------------------------
 *
 * @access    public
 * @param    string
 * @return    string
 */
if ( ! function_exists('asset'))
{
    function 
asset($uri)
    {
        
$_ci =& get_instance();
        return 
$_ci->config->base_url('assets/'.$uri);
    }
}

/**
 * fa_icon ()
 * ------------------------------------------------------------------------
 *
 * Author: brendan@ignitedcoder.com
 * Date: 8/24/15
 * Hope this helps you, please at least leave my name in place
 *
 * Modified by: kenan.recebli@gmail.com
 * Date: 5/3/16
 */
if ( ! function_exists('fa_icon'))
{
    
/**
     * Icon
     *
     * Generates an Font-Awesome icon tag.
     *
     * USAGE:
     *
     * <?php echo fa_icon('ambulance') ?>
     * or
     * <?php echo fa_icon('ambulance','fa-2x') ?>
     *
     * @param   string icon
     * @param   string attributes
     * @return  string
     */
    
function fa_icon($icon ''$attributes '')
    {
        return 
'<i class="fa fa-'.$icon.' '.$attributes.'"></i>';
    }
}


/**
 * ------------------------------------------------------------------------
 * Filename: asset_helper.php
 * Location: ./application/helpers/asset_helper.php
 * ------------------------------------------------------------------------
 */ 
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.