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

No longer possible make Theme functions calls from blueprints (data-*@). #1373

Closed
parcand opened this issue Mar 22, 2017 · 4 comments
Closed

Comments

@parcand
Copy link

parcand commented Mar 22, 2017

This feature does not seem to work anymore:
data-options@: ['\Grav\Theme\ImaginaryClass::getMyOptions', 'default', false]

Could it be related to the recent changes that have been made to the theme autoloader?
8741604

@rhukster
Copy link
Member

Well, it's possible, if you had this method inside your theme's standard class but that would assume your theme was called imaginary-class with the theme's class being: imaginary-class/imaginary-class.php.

@parcand
Copy link
Author

parcand commented Mar 23, 2017

Thanks for pointing that out. It made me realize that I was wrongfully using camelCase for both my theme folder and primary class file name. I will make sure to rename my stuff using hyphens as words separators. That said, thank you for the quick fix, I'm sure it will help other people who might have made the same mistake.

@parcand parcand closed this as completed Mar 23, 2017
@ash0080
Copy link
Contributor

ash0080 commented May 26, 2017

@rhukster
data-default@ doesn't seem to work now, data-options@ works
only test in admin
as official tutorial:
data-default@: '\Grav\Plugin\Admin::route'

@rhukster
Copy link
Member

This works for me. However, if there is an error in your static method, it will appear that the data-@ option is not working. I found this out the hard way this week :)

Try calling a known working function then maybe just call your static function from your plugin code directly to ensure things work as expected and the correct value is returned.

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