Welcome Guest, Not a member yet? Register   Sign In
Where do I stick it? (be nice now)
#1

[eluser]Unknown[/eluser]
I'm recreating a functioning site in CI and finding it challenging to know where to put some code: main controller, helper, directly in the view, or other place. I need to create an anchor tag that will include some dynamic mouseover JavaScript code and a dynamic link as well as. They will vary depending on a provided query parameter, or in CI's case, the method's second URL section. So, if the second parameter is a 1, the anchor tags target controller must change from the default to, say, the admin controller, which will load the data into an admin page so the viewer can edit that.

It would be a simple task of checking a value in the data[] array, like $IsAdmin, but I want to dynamically vary the anchors and javascript methods based on some other data in the $query, so I thought I should encapsulate the more complex logic in a separate function. However, where should I store it (controller itself, plugin, library), and how can I include it for the view to be able to call the function which will do the actual dynamic anchor creation.

Thanks in advance.

Jme


Messages In This Thread
Where do I stick it? (be nice now) - by El Forum - 01-20-2010, 08:44 PM
Where do I stick it? (be nice now) - by El Forum - 01-20-2010, 09:15 PM
Where do I stick it? (be nice now) - by El Forum - 01-20-2010, 09:28 PM
Where do I stick it? (be nice now) - by El Forum - 02-09-2010, 08:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB