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

Document array and object property access #1010

Open
cweiske opened this issue Oct 16, 2024 · 2 comments
Open

Document array and object property access #1010

cweiske opened this issue Oct 16, 2024 · 2 comments

Comments

@cweiske
Copy link

cweiske commented Oct 16, 2024

The "fluid syntax" documentation at https://docs.typo3.org/other/typo3fluid/fluid/main/en-us/Usage/Syntax.html does not talk about how to access array and object properties.

It should show the following cases, preferably with syntactically equivalent PHP code:

  • Accessing an array with a known key: myarrayvar.23 (php: $myarrayvar[23])
  • Accessing an object property with a known name: myobject.myproperty (php: $myobject->myproperty)
  • Accessing an array with the key in a variable: ??? (php: $myarrayvar[$mykeyname])
  • Accessing an object property with the property in a variable: ??? (php: $myobject->$myvarname)
  • Accessing getter/isset/has methods: myobject.foo (php: $myobject->getFoo())
@mbrodala
Copy link
Contributor

Fun fact: it is already documented here: https://github.com/TYPO3/Fluid/blob/3510df3031d978f3fb8128f973a9d70eddb99df8/examples/Resources/Private/Singles/Variables.html

So if you could open a PR to copy the necessary info to the officially rendered docs, that would be wonderful. :-)

@s2b
Copy link
Contributor

s2b commented Oct 16, 2024

Yes, there are certainly some blind spots in the documentation we need to address. We will gladly accept PRs in this area.

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

No branches or pull requests

3 participants