rfc:shortags
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:shortags [2008/04/03 20:52] – stas | rfc:shortags [2011/05/19 16:34] – rasmus | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2008-04-03 | * Date: 2008-04-03 | ||
* Author: Stas Malyshev < | * Author: Stas Malyshev < | ||
- | * Status: | + | * Status: |
- | + | ||
- | + | ||
Line 24: | Line 21: | ||
Last visited at <?= $lastvisit ?> | Last visited at <?= $lastvisit ?> | ||
</ | </ | ||
+ | |||
+ | The second form looks much nicer and cleaner, and can be easily understood and edited by non-PHP people like graphical designers, copy editors, etc. However, to use this form, the **short_open_tag** INI setting should be enabled. When this tag is enabled, **<?** also is treated as PHP starting tag, which may be a problem for people using XML in templates, since the engine would confuse XML starting tag with PHP code start. | ||
+ | |||
+ | |||
+ | ==== Proposals ==== | ||
+ | |||
+ | To try and enable people to write short and nice templates, while keeping all XML folks happy, the following solutions were proposed: | ||
=== Runtime short tags === | === Runtime short tags === | ||
Line 29: | Line 33: | ||
Make short_open_tags settable in runtime, thus allowing the template engine to turn it on when parsing template, while leaving the opportunity for the user to keep it off outside template parsing. | Make short_open_tags settable in runtime, thus allowing the template engine to turn it on when parsing template, while leaving the opportunity for the user to keep it off outside template parsing. | ||
- | * **Pro**: Allows the setting to be controlled locally without the user needing to do any administration or configuration | + | |
- | * **Contra**: If the setting " | + | * **Contra**: If the setting " |
=== Always available template tags === | === Always available template tags === | ||
Line 36: | Line 40: | ||
Make the tag **<?=** work even when short_open_tag is off, thus allowing nice templates without breaking the XML templates. | Make the tag **<?=** work even when short_open_tag is off, thus allowing nice templates without breaking the XML templates. | ||
- | * **Pro**: Allows the nice templates to always work, while keeping XML templates working with short_open_tag being off. | + | |
- | * **Contra**: Templates with this tag wouldn' | + | * **Contra**: Templates with this tag wouldn' |
=== Make other syntax === | === Make other syntax === | ||
Line 43: | Line 47: | ||
Make some other short XML-compliant syntax (such as **<?:**) to be used in templates. | Make some other short XML-compliant syntax (such as **<?:**) to be used in templates. | ||
- | * **Pro**: Allows both XML checkers and template writers to be happy | + | |
- | * **Contra**: Unusual syntax not supported by 100% of tools and not familiar to 100% of users | + | * **Contra**: Unusual syntax not supported by 100% of tools and not familiar to 100% of users |
rfc/shortags.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1