konekt/smarty3-include-if-exists

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

Installs: 8 543

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 1

Forks: 5

Open Issues: 1

pkg:composer/konekt/smarty3-include-if-exists

1.1.2 2016-05-08 21:11 UTC

This package is auto-updated.

Last update: 2025-09-18 23:20:15 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");