From 1470251f18c3b67842045acea99a8532f8c3a019 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Tue, 17 Nov 2009 19:03:06 +0000 Subject: [PATCH] - renamed extend tag and resource to extens: {extends file='foo.tol'} , $smarty->display('extends:foo.tpl|bar.tpl); --- README | 12 ++++++------ change_log.txt | 1 + ...xtend.php => smarty_internal_compile_extends.php} | 6 +++--- ...tend.php => smarty_internal_resource_extends.php} | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) rename libs/sysplugins/{smarty_internal_compile_extend.php => smarty_internal_compile_extends.php} (96%) rename libs/sysplugins/{smarty_internal_resource_extend.php => smarty_internal_resource_extends.php} (98%) diff --git a/README b/README index a6905827..b3f8714f 100644 --- a/README +++ b/README @@ -342,13 +342,13 @@ parent.tpl: child.tpl: -{extend file='parent.tpl'} +{extends file='parent.tpl'} {block name='title'} Child title {/block} grandchild.tpl: -{extend file='child.tpl'} +{extends file='child.tpl'} {block name='title'}Home - {$smarty.parent}{/block} {block name='page-title'}My home{/block} {block name='content'} @@ -377,17 +377,17 @@ If we render grandchild.tpl we will get this: -NOTE: In the child templates everything outside the {extend} or {block} tag sections +NOTE: In the child templates everything outside the {extends} or {block} tag sections is ignored. The inheritance tree can be as big as you want (meaning you can extend a file that extends another one that extends another one and so on..), but be aware that all files have to be checked for modifications at runtime so the more inheritance the more overhead you add. -Instead of defining the parent/child relationships with the {extend} tag in the child template you -can use the extend resource as follow: +Instead of defining the parent/child relationships with the {extends} tag in the child template you +can use the s resource as follow: -$smarty->display('extend:grandchild.tpl|child.tpl|parent.tpl'); +$smarty->display('extends:grandchild.tpl|child.tpl|parent.tpl'); Child {block} tags may optionally have a append or prepend attribute. In this case the parent block content is appended or prepended to the child block content. diff --git a/change_log.txt b/change_log.txt index e76536fa..a54add50 100644 --- a/change_log.txt +++ b/change_log.txt @@ -3,6 +3,7 @@ - use _dir_perms and _file_perms properties at file creation - new constant SMARTY_RESOURCE_DATE_FORMAT (default '%b %e, %Y') which is used as default format in modifier date_format - added {foreach $array as $key=>$value} syntax +- renamed extend tag and resource to extens: {extends file='foo.tol'} , $smarty->display('extends:foo.tpl|bar.tpl); 11/15/2009 - lexer/parser optimizations on quoted strings diff --git a/libs/sysplugins/smarty_internal_compile_extend.php b/libs/sysplugins/smarty_internal_compile_extends.php similarity index 96% rename from libs/sysplugins/smarty_internal_compile_extend.php rename to libs/sysplugins/smarty_internal_compile_extends.php index 521d20ad..75c78900 100644 --- a/libs/sysplugins/smarty_internal_compile_extend.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -3,7 +3,7 @@ /** * Smarty Internal Plugin Compile extend * -* Compiles the {extend} tag +* Compiles the {extends} tag * * @package Smarty * @subpackage Compiler @@ -12,9 +12,9 @@ /** * Smarty Internal Plugin Compile extend Class */ -class Smarty_Internal_Compile_Extend extends Smarty_Internal_CompileBase { +class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase { /** - * Compiles code for the {extend} tag + * Compiles code for the {extends} tag * * @param array $args array with attributes from parser * @param object $compiler compiler object diff --git a/libs/sysplugins/smarty_internal_resource_extend.php b/libs/sysplugins/smarty_internal_resource_extends.php similarity index 98% rename from libs/sysplugins/smarty_internal_resource_extend.php rename to libs/sysplugins/smarty_internal_resource_extends.php index 8614bcaf..bfdaefd0 100644 --- a/libs/sysplugins/smarty_internal_resource_extend.php +++ b/libs/sysplugins/smarty_internal_resource_extends.php @@ -1,7 +1,7 @@ smarty = $smarty;