smarty-php / smarty-php/smarty

inheritance using block tag seems not to result in a single compiled file in Smarty 5.7

Open
#1,154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
2.3k
Forks
709
PR merge metrics
No merged PRs in 30d

Description

Since {include ... inline} does not inline code in Smarty v5 (#1152) I had a look around in the documentation and it seems that {block} tags are the meant to do exactly that. From the Template inheritance page:

Template inheritance is a compile time process which creates a single compiled template file. Compared to corresponding solutions based on subtemplates included with the {include} tag it does have much better performance when rendering.

However, when testing it, it created a compiled file for each of the templates in the inheritance chain and none of them contains the full result. Is the documentation out of date or is this a bug? Maybe I'm just missing some settings? I saw an issue (#1134) claiming that Smarty v5 is slower than Smarty v4. Could this be related?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Template inheritance documentation and reproduce the reported inheritance chain using {block} tags. Inspect the generated compiled files and compare the result with the documented single-file behavior, including the context from issue #1152. Done means confirming whether Smarty 5.7 is buggy or the documentation needs correction, with the relevant settings or reproduction details recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.