From: Chris S. <too...@ph...> - 2009-07-25 13:44:50
|
Author: toonarmy Date: Sat Jul 25 11:23:05 2009 New Revision: 9848 Log: Add some docs for dynamic includes adding in r9570 Modified: branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html Modified: branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html (original) --- branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html Sat Jul 25 11:23:05 2009 *************** *** 1116,1121 **** --- 1116,1131 ---- <p>You will note in the 3.0 templates the major sources start with <code><!-- INCLUDE overall_header.html --></code> or <code><!-- INCLUDE simple_header.html --></code>, etc. In 2.0.x control of "which" header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common "menu" bar or some such. No need to modify loads of files as with 2.0.x.</p> + <p>Added in <strong>3.0.6</strong> is the ability to include a file using a template variable to specify the file, this functionality only works for root variables (i.e. not block variables).</p> + <div class="codebox"><pre> + <span class="comment"><!-- INCLUDE {FILE_VAR} --></span> + </pre></div> + <p>Template defined variables can also be utilised. + <div class="codebox"><pre> + <span class="comment"><!-- DEFINE $SOME_VAR = 'my_file.html' --></span> + <span class="comment"><!-- INCLUDE {$SOME_VAR} --></span> + </pre></div> + <h4>PHP</h4> <p>A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:</p> |