konekt / smarty3-include-if-exists
Smarty v3 plugin for specifying conditional inclusion of subtemplates within smarty templates
Installs: 8 542
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 5
Open Issues: 1
Requires
- php: >=5.2
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
- The easy way: copy the file compiler.include_if_exists.php in your smarty plugins directory.
- 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");