By design in both engines: an included partial sees the caller's variables and its own assignments stay inside it. Smarty gets a value out with {$seen = true scope='parent'}; Twig cannot, but the platform's set also stores the value in _templateContext, where the caller reads it. The context works the same in both and is the portable choice.
Answer
Templates and engines
A variable set inside an include does not survive outside it
More in Templates and engines
Was this page helpful?
Your answer goes to the docs team.