You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ben Peachey edited this page May 4, 2025
·
1 revision
Plaintext is not XML
PHPTAL intentionally doesn't support plaintext output.
For plaintext you don't need automatic escaping, strict syntax/structure checks (which are strengths of PHPTAL), but you need precise control of whitespace (which is hard to do in XML).
For plaintext, you can use standard PHP or Smarty-like as a templating language. Their ignorance of structure and lack of escaping by default, which are troublesome for XML, are exactly what you need for plain text.
Using PHPTAL's variables outside PHPTAL templates
If you want to reuse variables from PHPTAL object in raw PHP templates, then use:
<?php$ctx = $phptal->getContext();
?>
<?=$ctx->variable_name?>
You can also access TALES paths outside templates: