Welcome Guest, Not a member yet? Register   Sign In
Understanding MVC: Can same views be used for all pages, no matter what?
#2

[eluser]jblack199[/eluser]
Well, in the case of having 1 view that looks the same except for the data listed on that page you'd do it just like anything else....

in your model you'd have it obtain the information like an array or whatever....

you'd then do your echo just like you would echo any array... echo $array['title']; within the <title></title> tags and echo $array['message']; in the body...

getting it so you can do echo form_input(); type functionality you'd need one function for each in your helper.. and you'd need to passthrough the id of the page you're trying to grab so that the page data and the title data functions are grabbing from the same row...

in terms of programming it so you can echo out the 'function' as long as you have that return in there you're golden as echo function(); would be the same as echo $data; and of course $data being $data = function(); so you just bypass the middle man by echoing the function...


Messages In This Thread
Understanding MVC: Can same views be used for all pages, no matter what? - by El Forum - 08-10-2011, 01:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB