From 0ca0d180deab8daa5830bdf9e2487666f60a9a24 Mon Sep 17 00:00:00 2001 From: Giuseppe Mazzapica Date: Thu, 2 Jul 2015 23:00:12 +0200 Subject: [PATCH] Update documentation for v0.6 --- README.md | 12 ++ docs/EXTENDING/CUSTOM-BLOCKS.md | 95 +++++++++ docs/EXTENDING/CUSTOM-EXTENSIONS.md | 58 +---- docs/FUNCTIONS/BLOCKS.md | 81 +++++++ docs/FUNCTIONS/HTML-HELPERS.md | 2 +- docs/FUNCTIONS/LINK-HELPERS.md | 2 +- docs/FUNCTIONS/LOOP-HELPERS.md | 2 +- docs/FUNCTIONS/URI-HELPERS.md | 2 +- docs/GETTING-STARTED/ALIAS.md | 46 ++++ docs/GETTING-STARTED/ENGINE.md | 43 +++- docs/GETTING-STARTED/FOLDERS.md | 152 +++++++++++-- docs/GETTING-STARTED/INSTALLATION.md | 2 +- docs/INTEGRATE/API.md | 305 +++++---------------------- docs/INTEGRATE/OVERVIEW.md | 53 +---- docs/TEMPLATES/OVERVIEW.md | 6 + docs/TEMPLATES/SECTIONS-RENDERING.md | 107 ++++++++++ 16 files changed, 589 insertions(+), 379 deletions(-) create mode 100644 docs/EXTENDING/CUSTOM-BLOCKS.md create mode 100644 docs/FUNCTIONS/BLOCKS.md create mode 100644 docs/GETTING-STARTED/ALIAS.md create mode 100644 docs/TEMPLATES/SECTIONS-RENDERING.md diff --git a/README.md b/README.md index d17e76c..7b7672b 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ FOIL ...and many more + # Why? Templates engines like Twig, or Blade are a great thing, really. @@ -47,6 +48,17 @@ I wrote [a blog post](http://gm.zoomlab.it/2015/template-engines-i-moved-from-lo Foil is framework agnostic, only thing needed is PHP 5.4+ and Composer to add Foil to you PHP project. +--- + +# Backward Incompatibility Notice + +Foil version **0.6** introduced backward incompatibility changes. Internal objects mechanism changed a lot, but +core features and especially template functions were not affected. + +Please see v0.6 release notes to know more on the topic. + +--- + # License Foil is open source and released under MIT license. See LICENSE file for more info. diff --git a/docs/EXTENDING/CUSTOM-BLOCKS.md b/docs/EXTENDING/CUSTOM-BLOCKS.md new file mode 100644 index 0000000..deedb1d --- /dev/null +++ b/docs/EXTENDING/CUSTOM-BLOCKS.md @@ -0,0 +1,95 @@ + + +# Custom Blocks + +Custom blocks are callback that perform operations on a block of HTML that is delimited in templates using +`block()` and `endblock()` template methods. + +Please have a look at the section "*Blocks & Helpers / Blocks*" to know more about blocks. + +## Add a custom block + +Adding a block callback is as easy as pass a block name and a block callback to the `Engine::registerBlock()` method. + +For example, let's write a callback that takes a block of text, and output every new line in a separate `
  • ` tag, all wrapped in a `