====== Examples ====== [[http://beilpuz.get-mike.de/bp0.3/examples/index.php|All Examples]] are included in the Beilpuz archive. ===== Directory structure ===== * //bp///: Beilpuz classes. * //examples///: Example files. * //templates///: HTML template files. * //signatures///: Additional signatures exclusive written for the examples. * //compiled///: Compiled templates. * //cache///: Cached templates. * //tests///: Some test files. ====== Basics ====== ===== Include other templates ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/02-include templates.php|Live example]] This example shows, how to load a template and include another. ===== Render arrays and objects ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/03-arrays and objects.php|Live example]] It is possible to render the inner template of a block in a loop by using the //foreach// signature. ===== Share values between templates ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/05-share values between templates.php|Live example]] You can share assigned values between templates with the //include// signature. This file includes the title template and shares its values. ===== Custom attributes ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/06-signatures with attributes.php|Live example]] You can specify custom attributes as you like. ===== Inline templates ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/08-signatures with content.php|Live example]] Signatures can contain further template code. ===== Enable caching ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/07-cached template.php|Live example]] Cache files of templates can be created if they contain cacheable signatures. =====Simple conditions ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/10-conditions.php|Live example]] Very simple conditions with the //value// and //is// atributes of signature //if//, //elseif// and //else//. =====Custom delimiters ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/tests/04-change delimiters.php|Live example]] If you dont like the tag-delimiters, you can choose you own. ====== Advanced ====== ===== Custom signatures ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/04-own signatures.php|Live example]] Writing custom signatures is easy. ===== Partial caching ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/09-cache range.php|Live example]] You can decide during runtime if you want to create a cache file of this template. ===== Collecting signatures ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/11-collectors.php|Live example]] You can write signatures that collect their inline templates for putting them out at another position. ===== Extended conditions ===== * [[http://beilpuz.get-mike.de/bp0.3/examples/12-extended conditions.php|Live example]] You can create extended conditions with the //expr// attribute of signature //if//.