Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
txp:variable in plugin
Hi there,
probably I’m very stupidly overlooking something here. But how can I access the global $variables
in a plugin, say admin side?
The variables a decleared in a form (with <txp:variable name="this_name" value="this_value" />
). I tried to parse that form (parse_form()
) in the plugin but it seems that they are somewhere else populated into the global namespace not just by parsing. The globals $variables remains null
.
Can someone enlighten me.
Thanks in advance.
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Re: txp:variable in plugin
Never mind. Figured it out. For future reference:
global $variable;
require_once(txpath . '/lib/txplib_publish.php');
require_once(txpath . '/publish/taghandlers.php');
require_once(txpath . '/lib/txplib_html.php');
$form = safe_field('Form', 'txp_form', "name = 'form_name_with_txp_variables'");
parse($form);
// now we have access to the $variables
dmp($variable);
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Pages: 1