rfc:shortags

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:shortags [2008/04/03 20:53]
stas
rfc:shortags [2017/09/22 13:28] (current)
Line 3: Line 3:
   * Date: 2008-04-03   * Date: 2008-04-03
   * Author: Stas Malyshev <stas@php.net>   * Author: Stas Malyshev <stas@php.net>
-  * Status: Under Discussion +  * Status: Implemented in PHP 5.4 (Always available ''<?='')
- +
- +
- +
- +
  
  
Line 26: Line 21:
 Last visited at <?= $lastvisit ?> Last visited at <?= $lastvisit ?>
 </code> </code>
 +
 +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 32: Line 34:
  
   * **Pro**: Allows the setting to be controlled locally without the user needing to do any administration or configuration   * **Pro**: Allows the setting to be controlled locally without the user needing to do any administration or configuration
-  * **Contra**: If the setting "leaks" (such as by template having an exception which is not properly caught by the engine, etc.) it may influence othe application parts and break them.+  * **Contra**: If the setting "leaks" (such as by template having an exception which is not properly caught by the engine, etc.) it may influence other application parts and break them.
  
 === Always available template tags === === Always available template tags ===
rfc/shortags.1207256014.txt.gz · Last modified: 2017/09/22 13:28 (external edit)