Cherrycake provides a patterns parser that uses PHP code to integrate your code seamlessly with your template files, providing advanced Cherrycake capabilities to your template structures.
- Because you can unlimitedly nest patterns, you can create neat pattern structures for re-usability.
- Patterns can receive variables, making for an interesting way of reusing HTML code as objectified fragments, and other similar applications.
- Pattern files can get access to the entire Cherrycake engine, so you can use Cherrycake PHP code in your patterns.
- No need to learn a pattern language, just use PHP. Conditional statements, loops and any other PHP code will work in a pattern.
- Patterns works with the Cache module to provide a pattern-level cache, meaning that individual patterns can be cached as you like to improve performance. Because patterns can be nested, you can cache only the patterns that contain static or almost static information, and let only patterns with dynamic information be parsed each time they're used.
Because Patterns is actually a Cherrycake core module, you can use any other template parser you like in your Cherrycake app, build your own or get rid of any template mechanism if you like.