-
Notifications
You must be signed in to change notification settings - Fork 20
{exp:stash:unset}
Mark Croxton edited this page Jun 21, 2013
·
3 revisions
Unset an existing variable or matching set of variables.
Note: {exp:stash:unset}
requires PHP 5.2.3+. Alternatively you can use {exp:stash:destroy}
The name of a variable, or a regular expression matching part or all of the variable name (optional).
The variable namespace (optional).
The type of the variable you wish to unset (optional, default is 'variable').
The variable scope (optional, default is determined by the stash_default_scope
config value). Pass all
to unset variables regardless of their scope.
Limit the unset to variables in a named bundle (optional)
Delete the variable value from the database, if it has been saved (optional, default is 'yes').
{!-- unset 'my_var' --}
{exp:stash:unset name="my_var"}
{!-- unset 'my_var' snippet --}
{exp:stash:unset name="my_var" type="snippet"}
{!-- unset all vars which start with 'my_' --}
{exp:stash:unset name="#^my_#"}
{!-- unset all user-scoped variables --}
{exp:stash:unset scope="user"}
{!-- unset all site-scoped variables in the 'static' bundle --}
{exp:stash:unset scope="site" bundle="static"}
{!-- unset all variables with the name 'my_var' in the @URI context --}
{exp:stash:unset context="@URI" name="my_var"}
{!-- unset all variables that begin with 'my_' in the 'my_context' context --}
{exp:stash:unset name="#^my_context:my_#"}
Getting started
Using Stash
Using Mustash
- Mustash
- Installing Mustash
- Managing variables
- Managing bundles
- Cache-breaking rules
- Mustash plugins
- Mustash Varnish plugin
- Mustash plugin development
- Mustash API
Template design patterns
Tag reference
- {exp:stash:set}
- {exp:stash:get}
- {exp:stash:block}
- {exp:stash:set_value}
- {exp:stash:append}
- {exp:stash:append_value}
- {exp:stash:prepend}
- {exp:stash:prepend_value}
- {exp:stash:copy}
- {exp:stash:context}
- {exp:stash:is_empty}
- {exp:stash:not_empty}
- {exp:stash:set_list}
- {exp:stash:get_list}
- {exp:stash:append_list}
- {exp:stash:prepend_list}
- {exp:stash:split_list}
- {exp:stash:join_lists}
- {exp:stash:list_count}
- {exp:stash:unset}
- {exp:stash:flush_cache}
- {exp:stash:bundle}
- {stash:embed}
- {exp:stash:extend}
- {exp:stash:parse}
- {exp:stash:cache}
- {exp:stash:static}
- {exp:stash:finish}
- {exp:stash:not_found}
- Short tag syntax
- Using Stash methods in your own add-ons