CodeIgniter Forums

Full Version: xhtml-ending Tag in Helpers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
is there a possibility to insert helper-tags without the xhtml ending-tag "/>"?
Like a switch to toggle this behaviour?

Best regards.
Hmmm - I am not aware of such a tag in any of the CI helpers.
Can you give an example of one of these?
For example in the file "html_helper.php" the "meta"-function returns the meta-tag with "/>".
Also the returned fields in "form_helper.php".
Now your reference makes sense Smile No, there is no way to toggle that in stock CI.

You could over-ride the functionality by creating application/helpers/MY_html_helper and MY_form_helper, and providing replacement functions for the ones you want to behave differently. See http://www.codeigniter.com/user_guide/ge...ng-helpers
@basenic

Why?
(06-09-2016, 01:21 AM)basenic Wrote: [ -> ]Hello,
is there a possibility to insert helper-tags without the xhtml ending-tag "/>"?
Like a switch to toggle this behaviour?

Best regards.

Why would you even want to do this? In HTML you should close empty tags as well.
Get into the habit of writing well formed code. It will help you a lot in the long run.
In html 5 they removed the ending tag /> to just > it does not matter either way it will still work.
Oh...thats a bummer. As InsiteFX already wrote, we are only coding in HTML5 anymore. There are no closing slash-tag. Same for HTML4 (not xhtml).

Does anybody know if such an option is considered for CI4?