mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-03 05:41:37 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			56 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
*normal mode* :
 | 
						|
- add CDATA sections in all programlistings.
 | 
						|
- add roles to programlisting (especially role="php") and add PHP tags in PHP examples (short_open_tag is banned). This will help to :
 | 
						|
 -- check parse errors : for i in $(ls |grep xml); do php -d short_open_tag=off -l $i; done
 | 
						|
 | 
						|
*pedentic mode* :
 | 
						|
- fix indenting in all .xml files : don't uses tabs, indent by a space. Here's a nice indentation :
 | 
						|
 | 
						|
<para>
 | 
						|
 <example>
 | 
						|
  <title />
 | 
						|
  <programlisting>
 | 
						|
<![CDATA[
 | 
						|
// ..
 | 
						|
]]>
 | 
						|
  </programlisting>
 | 
						|
 </example>
 | 
						|
</para>
 | 
						|
 | 
						|
- clean all the examples :
 | 
						|
(if aggreed) examples should be XHTML compliant and should stick to PEAR's coding standards.
 | 
						|
 | 
						|
Here's how a complete example, using PHP and templates, should be written :
 | 
						|
 | 
						|
   <example>
 | 
						|
    <title>html_image example</title>
 | 
						|
    <programlisting role="php">
 | 
						|
<![CDATA[
 | 
						|
<?php
 | 
						|
 | 
						|
require('Smarty.class.php');
 | 
						|
$smarty = new Smarty;
 | 
						|
$smarty->display('index.tpl');
 | 
						|
 | 
						|
?>
 | 
						|
]]>
 | 
						|
    </programlisting>
 | 
						|
    <para>
 | 
						|
     where index.tpl is:
 | 
						|
    </para>
 | 
						|
    <programlisting>
 | 
						|
<![CDATA[
 | 
						|
{html_image file="pumpkin.jpg"}
 | 
						|
]]>
 | 
						|
    </programlisting>
 | 
						|
    <para>
 | 
						|
     a possible output would be:
 | 
						|
    </para>
 | 
						|
    <screen>
 | 
						|
<![CDATA[
 | 
						|
<img src="pumpkin.jpg" alt="" border="0" width="44" height="68" />
 | 
						|
]]>
 | 
						|
    </screen>
 | 
						|
   </example>
 | 
						|
 |