Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 14 revisions

Here's my sIFR helper.

  1. Put "sifr_helper.php" in "helpers" folder.
  2. 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. [code] <link rel="stylesheet" href="<?php echo base_url(); ?>statics/sifr/sIFR-screen.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo base_url(); ?>statics/sifr/sIFR-print.css" type="text/css" media="print" />

<script src="<?php echo base_url(); ?>statics/sifr/sifr.js" type="text/javascript"></script>

[/code]

NOW, load your new helper by editing config/autoload.php [code] $autoload['helper'] = array('url', 'html', 'sifr'); [/code] OR by loading it in you controller [code] $this->load->helper('sifr'); [/code]

Finally you're ready to use it ! just write this code in your view ...! [code] echo sifr_it('Test'); //and it returns a string which contain the header and the script with the default values [/code]

And also you can passing custom values by array [code] 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 : $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 !!! */ [/code]

Download HERE [url=http://codeigniter.com/wiki/File:sIFR_helper.zip/]sIFR Helper Download[/url]

Enjoy .. Amr Numan Tamimi - brainythink :)

Clone this wiki locally