Using the PHP API in the templates

Digital collections websites perform a lot of common tasks: they display objects, render a paginated results list, etc. The DMGenericTemplateHelper class and its subclasses serve to make a lot of this common functionality as easy as possible to implement. For example, by leveraging DMResultsViewTemplateHelper::getHtmlPageLinks(), you can do what would ordinarily take several dozen lines of code in just one line. And if the way getHtmlPageLinks() works ever changes, all of your templates that call it will use the upgraded functionality automatically. (Keeping the same output HTML structure from version to version, so as not to break CSS rules, is a high priority.)

As the class diagram in the PHP API documentation depicts, DMGenericTemplateHelper has several subclasses, each one of which is meant to correspond to a particular view. The child classes are essentially all supersets of DMGenericTemplateHelper; they share all of its functionality, and add more of their own.