Welcome Guest, Not a member yet? Register   Sign In
loading helpers inside views
#7

[eluser]Aken[/eluser]
[quote author="Roopam" date="1356370780"]@benton.snyder Umm, I think its not about separating the backend from the front end. The "back end" I think refers to database related operations. I am referring probably to something like formatting strings (converting to camel case etc), date time calculations and the like[/quote]
Back end refers to server-side code, PHP in our case. Front end refers to HTML, CSS, and JS - client-side code. The goal is to mix as little PHP with your HTML and such as possible.

[quote author="Roopam" date="1356370780"]@PhilTem "Helpers are actually wrappers for views to call functions from libraries, models, or the controller" Well, this calls for extra code : writing helpers to get me the post values since we are not sure $this object is available in the view. Frankly this is heartbreaking, since I have been doing stuff like $this->config->item('fb_app_key'); for creating fb login javascript codes. But yes I do get the vibe here.[/quote]
$this has a much different scope inside the view than it does in your controllers and models. Another good reason to separate your logic.

For helper functions you use in your view(s), load them globally (autoload) or in your controller, depending on how often you need them.


Messages In This Thread
loading helpers inside views - by El Forum - 12-24-2012, 12:42 AM
loading helpers inside views - by El Forum - 12-24-2012, 06:44 AM
loading helpers inside views - by El Forum - 12-24-2012, 07:24 AM
loading helpers inside views - by El Forum - 12-24-2012, 10:39 AM
loading helpers inside views - by El Forum - 12-24-2012, 11:11 AM
loading helpers inside views - by El Forum - 12-24-2012, 03:50 PM
loading helpers inside views - by El Forum - 12-24-2012, 06:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB