Skip to content

Smarty capture BC break since 3.1.28 #153

Closed
@GodLesZ

Description

@GodLesZ

Since 3.1.28 Smarty capture works different and breaks existing code, again.
Also happend with Smarty::getVariable(), which was marked as deprecated and damaged at the same time (fixed since 3.1.29 but anyways).

Example for capture problem

layout.tpl

{block "content"}{/block}

index.tpl

{block "content"}
    {include "test-plugin.tpl"}
    {$smarty.capture.plugin}
{/block}

test-plugin.tpl

{capture "plugin"}
    test
{/capture }

index.php

$smarty->display('extends:layout.tpl|index.tpl');

The captured content is not available in the index.tpl.
If I move the capture tags to the index.tpl, everything works fine. So it seems to have a local scope to the current template now but no scope parameter like the assign tag.

Any chance to get

  1. BC in the future? 3.1.28 is a patch/build number
  2. a scope parameter or some advice how to accomplish the capture usage across multiple templates?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions