Best templating method? |
[eluser]Jelmer[/eluser]
I've treid a couple of ways, the 2 I liked most are: - Writing my own "view library" that I call once at the end of every controller and which takes care of all common tasks. This is most suited if you need a lot of different kinds of output and complex methods to compute them. - Use a base controller like this one from Jamie Rumbelow. I'm not using it directly but it was the inspiration for templating in some of my apps. I like this way a lot when the controller almost always needs default templating behavior and has only few deviations. Edit: Also I prefer to use a wrapper that loads other views within it depeding on a certain variable that's past to it. I prefer that over using a header and a footer, but I guess that's more a personal preference than a best practice. |
Messages In This Thread |
Best templating method? - by El Forum - 07-27-2010, 07:46 AM
Best templating method? - by El Forum - 07-27-2010, 08:03 AM
Best templating method? - by El Forum - 07-27-2010, 08:11 AM
|