A Helper, or more precisely a
ViewHelper, is a class that helps organize pure code from the context of pure template files by handling common and repetitive tasks. A use case for this could be a class that wraps the logic of thumbnail presentation for instance.
Creating a Helper file.
To generate a
ViewHelper, you should use the automated generator provided by Strata. It will validate your object’s name and ensure it is defined following the intended conventions.
Using the command line, run the
generate command from your project’s base directory. In this example, we will generate a view helper for the
The command generates a couple of files for you, including the actual
ViewHelper file and test suites for the generated class.