You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A template's $blocks array does not contain any parent's blocks. So when extending a template hasBlock returns false when the block in question does not exist in the child template. The rendering itself works fine since the block does exist in the parent's template.
So basically the hasBlock function is lacking consequence. There is no way to check if a block exists before rendering a template that extends others.
The text was updated successfully, but these errors were encountered:
hasBlock as all other methods in Twig_Template are for internal use only. You should not use them. hasBlock cannot return blocks for the parent as the parent template can be a dynamic value, which is only known based on the current context.
A template's $blocks array does not contain any parent's blocks. So when extending a template hasBlock returns false when the block in question does not exist in the child template. The rendering itself works fine since the block does exist in the parent's template.
So basically the hasBlock function is lacking consequence. There is no way to check if a block exists before rendering a template that extends others.
The text was updated successfully, but these errors were encountered: