Script tags => script_tag() |
[eluser]fdog[/eluser]
I've extended the html helper by modifying link_tag() function the to help me generate links to scripts. Needless to say, the usage is pretty much the same of link_tag(). The only default parameter is type, which is text/javascript. Example: Code: echo script_tag('scripts/tiny_mce.js'); Array example: Code: $script = array( Code: // ------------------------------------------------------------------------
[eluser]GreatSlovakia[/eluser]
Repaired working version, (solving two bugs) (One due to the CHILDISH way this forum handles script tags) Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]Bill Hernandez[/eluser]
Made some small changes to remove spaces whose syntax did not conform with syntax checker. Modified: added a boolean flag to accommodate html5 syntax SEE: http://www.tutorialspoint.com/html5/html5_syntax.htm MODIFY : /application/config/autoload.php make sure the extended helper is loaded first such as 'MY_html' before 'html', otherwise you will get a loading error $autoload['helper'] = array('url', 'MY_html', 'html', 'form'); Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Welcome Guest, Not a member yet? Register Sign In |