Welcome Guest, Not a member yet? Register   Sign In
Calling a helper method from a view
#8

[eluser]Alninio[/eluser]
Ah!

The reason I put it in a helper is because I was having difficulty calling the functions from the view. If someone can show me a quick code snippet of how a helper is instantiated and then called from a view I would be very grateful. I have tried:

$this->load->helper(array('url', 'setting', 'string'));

followed by

$display_channel_name = quotes_to_entities($row->channel_name);

but it just didn't seem to do anything.

In the end I just copied the strip_quotes() function from the string helper into my own helper, renamed it as MY_strip_quotes() and had it replace ' with \' and " with \"

Not perfect but it works.

I am now the calling the helper from my controller and building the string which I pass into the view to position correctly within the rest of the page.


Messages In This Thread
Calling a helper method from a view - by El Forum - 02-25-2009, 05:01 PM
Calling a helper method from a view - by El Forum - 02-25-2009, 06:40 PM
Calling a helper method from a view - by El Forum - 02-25-2009, 08:14 PM
Calling a helper method from a view - by El Forum - 02-25-2009, 08:44 PM
Calling a helper method from a view - by El Forum - 02-25-2009, 08:46 PM
Calling a helper method from a view - by El Forum - 02-25-2009, 10:35 PM
Calling a helper method from a view - by El Forum - 02-25-2009, 11:45 PM
Calling a helper method from a view - by El Forum - 02-25-2009, 11:59 PM
Calling a helper method from a view - by El Forum - 02-26-2009, 12:02 AM
Calling a helper method from a view - by El Forum - 02-26-2009, 06:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB