What do we do with numeric render children keys?

Created on 4 May 2025, 8 days ago

Problem/Motivation

Following πŸ› Incorrect render structure in Navigation PageContext Active , @nicxvan is asking about

Today, in a render arrays:

  • render properties are the array keys starting by "#", so they are always strings
  • render children are the array keys not starting by "#", so they can be anything allowed by PHP, so string or integers

Proposed resolution

  • Do we have render elements expecting only numeric render children keys? Which ones?
  • Do we have render elements expecting both string and numeric render children keys? Which ones?
    • Maybe html_tag because children are used as a workaround for inserting a renderable in HTML element content.
    • In πŸ› Incorrect render structure in Navigation PageContext Active , we are proposing to move slots to render children but it seems slots can also be numeric (^[a-zA-Z0-9_-]+). Is it the opportunity to challenge that?
  • Would it be relevant to forbid numeric render children keys or mixed render children keys?
πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

theme system

Created by

πŸ‡«πŸ‡·France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024