HTML Helper Extended - script_tag() added (Add .js files easily) |
[eluser]Isern Palaus[/eluser]
Hello, I was programming a website today (I was 2 months without touching any code) and I've seen that now CodeIgniter has a lot of features and one of them is the link_tag() for adding CSS files. But... What about the JavaScript? Here is a literaly modification of the link_tag() for using with [removed] File: /application/helpers/my_html_helper.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); We only need to write... Code: <?=script_tag('content/js/jquery-latest.js');?> This is my first CodeIgniter aportation, wish you like it. Sorry for my school english :-). Regards, -- Isern Palaus
[eluser]Kilroy[/eluser]
Hi, I found the above code to be incomplete (missing some stuff around line 25), and it didn't add a [removed] at the end. Here's a reviewed function: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]Blaze Boy[/eluser]
Isern Palaus: take some of your time to check my project (Vunsy) it's a project based on codeigniter to deliver a site in some hours without touching a code http://www.vunsy.co.cc it has the syntax that you need of adding javascript and css files in a click like that add('path/to/cssfile.css' ); add('path/to/jsfile.js' ); add( '[removed]' ); that is a smart function it can determine what fort of file you need to add to header check it out i think you'll like it |
Welcome Guest, Not a member yet? Register Sign In |