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

Base magic get doesn't check cached variable #228

Open
ikkez opened this issue Oct 23, 2017 · 2 comments
Open

Base magic get doesn't check cached variable #228

ikkez opened this issue Oct 23, 2017 · 2 comments

Comments

@ikkez
Copy link
Member

ikkez commented Oct 23, 2017

There's a different between
$f3->get('foo') and $f3->foo.

https://github.com/bcosca/fatfree-core/blob/b2e66eb1f27c61187c9608cc994673f9e501ed2c/base.php#L2097-L2099

Since offsetget uses the ref method instead get, it does not check the Cache here.
I'm not sure if that's an issue or maybe just something to note in the docs 🤔
Thoughts?

@xfra35
Copy link
Member

xfra35 commented Oct 23, 2017

Interesting!

I would say that since offsetset ignores the Cache instance (no ttl argument passed), then it makes sense that offsetget ignores it too.

So I vote for updating the docs.

@ikkez
Copy link
Member Author

ikkez commented Oct 26, 2017

alright.. adding this to the docs sounds fine.

Another thing: cached variables are not accessable within the template by default. That's somehow logical, because the sandbox receives a copy of the current HIVE by default, and cached variables are lazy-loaded on demand, which is great...so if you have not accessed / requested this variable from cache before, it's not present in template and cannot be fetched from there... worth a note in the docs as well.

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

No branches or pull requests

2 participants