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

Better variable accessor guessing #1590

Closed
RyanThompson opened this issue Jan 12, 2015 · 3 comments
Closed

Better variable accessor guessing #1590

RyanThompson opened this issue Jan 12, 2015 · 3 comments

Comments

@RyanThompson
Copy link

Because the convention in theming is generally snake case and in PHP it is camel, consider the following:

{{ foo.bar_baz }} the getter is missed because it seems to be looking for getBar_baz()

However {{ foo.barBaz }} properly relates to getBarBaz() as far as conventions go.

It SHOULD check for getBarBaz() (snake case entire variable name) which will work in both tag cases but suggest best practices on the PHP side of things.

@RyanThompson
Copy link
Author

Here I am guessing:

$type = ucfirst($this->getAttribute('type'));

I can send a PR in if there is an agreement here ^_^

@Tobion
Copy link
Contributor

Tobion commented Jan 12, 2015

Duplicate of #934

@RyanThompson
Copy link
Author

Wow sure is - should have searched better thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants