Skip to content

Conversation

@RobinDev
Copy link

@RobinDev RobinDev commented Oct 5, 2023

This commit contains 2 propositions without BC break :

  • Simplify template->data() return type (minor)
  • permit inheritance of data over layout (like twig, maybe major)

}

/**
* Assign or get template data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider to change this documentation to:

Assign or merge with existing template data.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, should be even :
(Assign|merge with existing) or get template data.

?

* Fetch a rendered template.
* @param string $name
* @param array $data
* @return string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$only is not documented. The name should is not yet optimal and clear to me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use the same name variable as twig - see https://twig.symfony.com/doc/3.x/tags/include.html#:~:text=only

Is it enough clear ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a second commit and rename it $useTemplateData

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

Successfully merging this pull request may close these issues.

2 participants