Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture append as item in associative array #366

Closed
vbezruchkin opened this issue May 17, 2017 · 2 comments
Closed

Capture append as item in associative array #366

vbezruchkin opened this issue May 17, 2017 · 2 comments

Comments

@vbezruchkin
Copy link

Hi guys,

We use Smarty in our opensource CMS and happy with it. If possible, please consider this request to be added to the default version.

make capture append work with associative arrays

So I could pass capture content to a new array element with name as key, for example.

Thanks in advance.

@vbezruchkin
Copy link
Author

Or could you please advise how to achieve this? @uwetews

Thanks in advance.

@uwetews
Copy link
Contributor

uwetews commented May 19, 2017

The named capture buffers can now be accessed as array()by special Smarty variable $smarty.capture.
This extension is now in the master branch and will later be included in 3.1.32

{capture name='foo'}
bah
{\capture}
{capture name='buh'}
blar
{\capture}
{foreach $smarty.capture as $name => $buffer}
....
{/foreach}

@uwetews uwetews closed this as completed May 19, 2017
uwetews added a commit that referenced this issue May 21, 2017
uwetews added a commit that referenced this issue May 21, 2017
…rray

    See NEWS_FEATURES.txt #366
    fixed bug in above change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants