sIFR helper

Derek Jones edited this page Jul 5, 2012 · 14 revisions
Clone this wiki locally

Here's my sIFR helper.

  1. Put "sifr_helper.php" in "helpers" folder.
  2. sifr's Swf-fonts, sifr's css, and sifr's js, as a default i put it in "<?php echo base_url(); ?>/statics/sifr/".
    • In your view put these lines.

&lt;link rel="stylesheet" href="&lt;?php echo base_url(); ?&gt;statics/sifr/sIFR-screen.css" type="text/css" media="screen" /&gt;
&lt;link rel="stylesheet" href="&lt;?php echo base_url(); ?&gt;statics/sifr/sIFR-print.css" type="text/css" media="print" /&gt;
    
&lt;script src="&lt;?php echo base_url(); ?&gt;statics/sifr/sifr.js" type="text/javascript"&gt;&lt;/script&gt;


NOW, load your new helper by editing config/autoload.php


$autoload['helper'] = array('url', 'html', 'sifr');

OR by loading it in you controller


$this->load->helper('sifr');

Finally you're ready to use it ! just write this code in your view ...!


echo sifr_it('Test'); 
//and it returns a string which contain the header and the script with the default values

And also you can passing custom values by array


echo sifr_it('Test with costum', array("link"=>"http://www.google.com", "font"=>"font_name")); 
//and it returns a string which contain the header and the script with your custom values
/*
HERE ARE THE DEFAULT VALUES, AND YOU CAN PASS NEW VALUE BY THE ARRAY: 
    $swfpath = base_url().'statics/sifr/';//SWF-fonts path
    $id = '';//for custom id, [DON'T repeat it in the same page]
    $link = '';//link for heading
    $header = '1';//heading size 1,2,3,4,5,6
    $font = 'tradegothic';//font name
    $sColor = '#000000';//heading color
    $sLinkColor = 'null';//[if] link color
    $sHoverColor = 'null';//Hover color
    $sBgColor = 'null';//heading background color
    $nPaddingTop = '0';/PaddingTop
    $nPaddingRight = '0';//PaddingRight 
    $nPaddingBottom = '0';//PaddingBottom 
    $nPaddingLeft = '0';//PaddingLeft 
    $textalign = '';//textalign {center, right, left}
    $offsetLeft = '';//offsetLeft=N Pushes text Npx to the right
    $offsetTop = '';/offsetTop=N Pushes text Npx down.
    $underline = '';//underline={true, false} Adds underline to links on hover
    $sCase = '';//Case {upper, lower}
    $sWmode = '';//sWmode {transparent, opaque} !!! unrecommended !!!
*/

Download HERE [File:sIFR_helper0.1.zip](http://codeigniter.com/wiki/File:sIFR_helper0.1.zip/)

Enjoy .. Amr Numan Tamimi - brainythink :)