"Fossies" - the Fresh Open Source Software Archive

Member "smarty-3.1.34/INHERITANCE_RELEASE_NOTES.txt" (28 Feb 2019, 4084 Bytes) of package /linux/www/smarty-3.1.34.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "INHERITANCE_RELEASE_NOTES.txt": 3.1.31_vs_3.1.32.

    1 3.1.3"
    2 New tags for inheritance parent and chilD
    3 {parent}  == {$smarty.block.parent}
    4 {child}  == {$smarty.block.child}
    5 Both tags support the assign attribute like
    6 {child assign=foo}
    7 
    8 3.1.31
    9 New tags for inheritance parent and child
   10 {block_parent}  == {$smarty.block.parent}
   11 {block_child}  == {$smarty.block.child}
   12 
   13 Since 3.1.28 you can mix inheritance by extends resource with the {extends} tag.
   14 A template called by extends resource can extend a subtemplate or chain buy the {extends} tag.
   15 Since 3.1.31 this feature can be turned off by setting the new Smarty property Smarty::$extends_recursion to false.
   16 
   17 3.1.28
   18 Starting with version 3.1.28 template inheritance is no longer a compile time process.
   19 All {block} tag parent/child relations are resolved at run time.
   20 This does resolve all known existing restrictions (see below).
   21 
   22 The $smarty::$inheritance_merge_compiled_includes property has been removed.
   23 Any access to it is ignored.
   24 
   25 New features:
   26 
   27 Any code outside root {block} tags in child templates is now executed but any output will be ignored.
   28 
   29    {extends 'foo.tpl'}
   30    {$bar = 'on'}           // assigns variable $bar seen in parent templates
   31    {block 'buh'}{/block}
   32 
   33    {extends 'foo.tpl'}
   34    {$bar}           // the output of variable bar is ignored
   35    {block 'buh'}{/block}
   36 
   37 {block} tags can be dynamically en/disabled by conditions.
   38 
   39    {block 'root'}
   40       {if $foo}
   41          {block 'v1'}
   42              ....
   43          {/block}
   44       {else}
   45          {block 'v1'}
   46              ....
   47          {/block}
   48       {/if}
   49    {/block}
   50 
   51 {block} tags can have variable names.
   52 
   53    {block $foo}
   54         ....
   55    {/block}
   56 
   57 Starting with 3.1.28 you can mix inheritance by extends resource with the {extends} tag.
   58 A template called by extends resource can extend a subtemplate or chain buy the {extends} tag.
   59 
   60 NOTE There is a BC break. If you used the extends resource {extends} tags have been ignored.
   61 
   62 THE FOLLOWING RESTRICTIONS ARE NO LONGER EXISTING:
   63 In Smarty 3.1 template inheritance is a compile time process. All the extending of {block} tags
   64 is done at compile time and the parent and child templates are compiled in a single compiled template.
   65 {include} subtemplate could also {block} tags. Such subtemplate could not compiled by it's own because
   66 it could be used in other context where the {block} extended with a different result. For that reasion
   67 the compiled code of {include} subtemplates gets also merged in compiled inheritance template.
   68 
   69 Merging the code into a single compile template has some drawbacks.
   70 1. You could not use variable file names in {include} Smarty would use the {include} of compilation time.
   71 2. You could not use individual compile_id in {include}
   72 3. Separate caching of subtemplate was not possible
   73 4. Any change of the template directory structure between calls was not necessarily seen.
   74 
   75 Starting with 3.1.15 some of the above conditions got checked and resulted in an exception. It turned out
   76 that a couple of users did use some of above and now got exceptions.
   77 
   78 To resolve this starting with 3.1.16 there is a new configuration parameter $inheritance_merge_compiled_includes.
   79 For most backward compatibility its default setting is true.
   80 With this setting all {include} subtemplate will be merge into the compiled inheritance template, but the above cases
   81 could be rejected by exception.
   82 
   83 
   84 If $smarty->inheritance_merge_compiled_includes = false; {include} subtemplate will not be merged.You must now manually merge all {include} subtemplate which do contain {block} tags. This is done by setting the "inline" option.
   85 {include file='foo.bar' inline}
   86 
   87 1. In case of a variable file name like {include file=$foo inline} you must use the variable in a compile_id  $smarty->compile_id = $foo;
   88 2. If you use individual compile_id in {include file='foo.tpl' compile_id=$bar inline} it must be used in the   global compile_id as well  $smarty->compile_id = $bar;
   89 3. If call templates with different template_dir configurations and a parent could same named child template from different folders
   90    you must make the folder name part of the compile_id.
   91