PHPTAL Wikihttps://phptal.org/wiki/2024-03-19T02:35:59+00:00FeedCreator 1.7.2-ppt DokuWikiPlayGround2023-08-16T22:25:09+00:002023-08-16T22:25:09+00:00https://phptal.org/wiki/doku.php/playground/playground?rev=1692224709&do=diff$love = "Standard"
$TTrue = true
<tal:block tal:condition="php: $TTrue == True">
Hello World
</tal>wiki:syntax2020-07-08T11:52:06+00:002020-07-08T11:52:06+00:00https://phptal.org/wiki/doku.php/wiki/syntax?rev=1594209126&do=diffMalikHelloZend Framework - Add Zend Framework 3 link2016-08-29T05:33:52+00:002016-08-29T05:33:52+00:00https://phptal.org/wiki/doku.php/frameworks?rev=1472448832&do=diffHow to get PHPTAL working with popular frameworks. Please add instructions or link to "glue" code, not just the frameworks themselves.
Zend Framework
* ZTal — deep integration of views, forms, translation, cache and other parts of Zend and PHPTAL.
* Zend Framework + PHPTAL tutorial with ready to use "glue" code.
* Short tutorial with Zend View example.
* Zend Expressive integration. Sample application can be found under Github repository.
* Zend Framework 3 integration.Source Resolver2016-02-10T22:39:00+00:002016-02-10T22:39:00+00:00https://phptal.org/wiki/doku.php/sourceresolver?rev=1455143940&do=diffYou can create fake filesystems for PHPTAL templates. This lets you load templates and macros from any source, e.g. a database.
Simplest way
If you don't use macros, you don't need SourceResolver:
$phptal->setSource(load_source_from_anywhere()); // No source resolver necessary
Implementing custom source
However, if you'd like to avoid fetching template source on every request (explained later), or would like to use macros that load additional templates, implement your own SourceResolve…Plaintext is not XML - old revision restored2015-11-26T10:37:45+00:002015-11-26T10:37:45+00:00https://phptal.org/wiki/doku.php/plaintext?rev=1448534265&do=diffPHPTAL 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.