Welcome Guest, Not a member yet? Register   Sign In
Using a helper function in the View file
#11

[eluser]CroNiX[/eluser]
Kind of hard to use the captcha_helper, form_helper, download_helper, table_helper, html_helper, smiley_helper, typography_helper and some others without using them in views. They're really designed for that purpose, and they mostly deal directly with outputting HTML, so they really belong in the view most of the time.

If you disagree, perhaps you might be able talk the CI developers into changing the user guide for the "helpers" section.
Quote:CodeIgniter does not load Helper Files by default, so the first step in using a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

If they didn't intend on us being able to use helpers in views, they probably wouldn't specifically say they're available to them.
#12

[eluser]Aken[/eluser]
Using helper functions in views is really dependent on who will be maintaining the view files, or if you make theming available through your application (like a CMS or something). If you want things to be as plain and simple as possible, don't use them (or use them and make some sort of document available that explains them). If it's not a big deal, use them to your heart's content.




Theme © iAndrew 2016 - Forum software by © MyBB