Welcome Guest, Not a member yet? Register   Sign In
Getting data from view file itself
#7

[eluser]charlie spider[/eluser]
i guess i tend to take a more strict approach to the MVC idea which i believe can help you in the long run.

from project to project, your database tables and therefore any code accessing them, are pretty much guaranteed to change, but the methods for manipulating data may not. if you keep your model to strictly be nothing more than the interaction between your database and the rest of your code, and keep all of your business logic in your controllers ( or helpers, or libraries ), then it is easier to reuse code for another project.

Using your example of overlaying text on an image using ImageMagick, you could write a controller ( or helper, or library ) that receives any variables and data it requires, does all of the work, and spits out the finished product, without having it chained to any particular database or view ( or controller ). When you finish this project and move onto the next, Hey !!! you can reuse that module of code with no extra work.

Separating your code into reusable chunks will save you time and money in the long run.

Entrenching your business logic in with other project (database) specific code will keep it forever entangled with that particular project.

so i guess i second sikkle.

create a helper

but i would call it from your controller if possible


Messages In This Thread
Getting data from view file itself - by El Forum - 06-22-2008, 08:46 PM
Getting data from view file itself - by El Forum - 06-22-2008, 09:38 PM
Getting data from view file itself - by El Forum - 06-29-2008, 11:25 AM
Getting data from view file itself - by El Forum - 06-29-2008, 12:10 PM
Getting data from view file itself - by El Forum - 06-29-2008, 12:24 PM
Getting data from view file itself - by El Forum - 06-29-2008, 03:28 PM
Getting data from view file itself - by El Forum - 06-29-2008, 05:01 PM
Getting data from view file itself - by El Forum - 06-30-2008, 02:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB