Page 2 of 2
Posted: Thu Feb 12, 2004 6:36 pm
by John Cartwright
That won't work because each individual map has a different variable for percentage and records, etc. :S
Posted: Thu Feb 12, 2004 7:11 pm
by McGruff
Yes, this is what you ought to do. It seems to be exactly the same html each case (if the html wasn't identical you would create as many html templates as you need).
Echo vars with the same names in the template. Set them in the script then just include the template.
Models (logic & vars) and views (html & formatting) are best kept separate.
Uh
Posted: Fri Feb 13, 2004 10:51 am
by eletrium
If you're claiming my refactor won't work, look again. It is creating a function (which you will have to be sure is the proper way to do it in PHP) and passing the information specific to each case into the function.
This is as simple as it gets.
As McG is saying, it is separating the View logic from the Control/Model logic... re-read it. I am passing in the vars specific to each case. Simple stuff...