konekt/smarty3-include-if-exists

Smarty v3 plugin for specifying conditional inclusion of subtemplates within smarty templates

1.1.2 2016-05-08 21:11 UTC

This package is auto-updated.

Last update: 2024-10-18 21:19:07 UTC


README

Summary

This is a smarty v3 plugin for specifying conditional inclusion of subtemplates within smarty templates.

For a similar plugin for smarty v2 click here

Usage

Use the following syntax in smarty templates: {include_if_exists file="foo.tpl" else="bar.tpl"}

Installation

  1. The easy way: copy the file compiler.include_if_exists.php in your smarty plugins directory.
  2. The silky way:
    • put the file compiler.include_if_exists.php in an arbitrary folder
    • add the plugin dir to smarty upon initialization $smarty->addPluginsDir("your/path/to/the/files");