CodeIgniter Forums
A Simple Font Awesome Helper - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: A Simple Font Awesome Helper (/showthread.php?tid=64488)



A Simple Font Awesome Helper - BrendanRehman - 02-24-2016

I use this one a good deal... in my project.

https://github.com/IgnitedCoder/codeigniter-fontaweseome-helper

Super simple and easy to use... See Readme.

Enjoy,
Brendan


RE: A Simple Font Awesome Helper - Tecvid - 03-23-2016

i have made it even more simple, n no need to update Smile this will work even after font awesome will add new icons after update

PHP Code:
<?php
/**
 * Author: [email protected]
 * Date: 8/24/15
 * Hope this helps you, please at least leave my name in place
 * 
 * Modified by: [email protected]
 * Date: 5/3/16
 */
defined('BASEPATH') OR exit('No direct script access allowed');
if ( ! 
function_exists('fa_icon'))
{
    
/**
     * Icon
     *
     * Generates an Font-Awesome icon tag.
     *
     * @param    string icon
     * @param    string attributes
     * @return    string
     */
    
function fa_icon($icon ''$attributes '')
    {
        return 
'<i class="fa fa-'.$icon.' '.$attributes.'">'.'</i>';
    }