CodeIgniter: Extend HTML Helper, script_tag(); added
June 26th, 2008Since pass to 1.5 to 1.6 from CodeIgniter, the framework I actually use, has added various functions with notable consequences.
- img()
Lets you create HTMLtags. The first parameter contains the image source. There is data, the second the size of the heading.
- link_tag()
Lets you create HTML tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates.
And more others with form related are the most useful for me. When I have seen what link_tag() does, I’ve think that how potential will be a function in HTML Helper that allows you to add JavaScript files. I started thinking that how this can be developed and what I did is open the existing helper, looked for link_tag() code and modified to add JavaScript files.
Now this function is full working and you can use to reduce the code on your
tags. I recommend it because is easiest to modify anything and you don’t need to write the code.It looks like:
Read the rest of this entry »
Tags: CodeIgniter, Helper, PHP
