Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify data return type and permit inheritance of data over layout and fetch #321

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from

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)

@@ -110,15 +110,15 @@ public function __toString()
/**
* 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.

?

@@ -311,9 +311,9 @@ public function section($name, $default = null)
* @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.

None yet

2 participants