3 ms·
I was playing around with Slim framework recently and I 'discovered' the option in the PDO driver to fetch into a class. Add a parent class to the data classes
by krapp 13y ago
I was playing around with Slim framework recently and I 'discovered' the option in the PDO driver to fetch into a class. Add a parent class to the data classes (with magic setters and getters, having the getter wrap everything in htmlspecialchars)[1] and you really can, probably, accomplish most of what a lot of templating systems do (and a good chunk of MVC with the serial numbers filed off) with a fraction of the code in most frameworks and, say, Twig.
Even static caching probably, using output buffering.
[1]http://stackoverflow.com/questions/8898794/using-pdofetch-class-with-magic-methods http://stackoverflow.com/questions/8898794/using-pdofetch-cl...